mozilla/Socorro-Tests — pull request #178 by bobsilverberg (2012-09-03 16:23:20+00:00)
Title: proof-of-concept for using __getattr__ in place of properties

This is a proof-of-concept for replacing page object properties which simply retrieve the text at a locator with __getattr__.

It bothers me that we need to add a property definition for each of these in every page object, when each property definition does the exact same thing. We can remove all of those property definitions by using the __getattr__ method in this pull request.

I understand that the downside to this is that someone writing a test would not know which properties are available, except by looking at the code for the page object and finding the locators. Perhaps that is reason enough not to entertain using this method, but I thought it worth bringing up as it would certainly save a lot of code.

Please note that this pull request is not meant to be merged - it is just presented as an illustration of an idea.