widgetastic.core
widgetastic.core copied to clipboard
locator arg placement inconsistency across widgets
Some of widgets are accepting locator arg as first arg, e.g. Text(), Table(), Select(), etc.
Others (usually inputs) - as a third or forth, the first one for them is name. Few examples are TextInput(), Checkbox().
This brings some confusion, as sometimes i have to specify locator= and sometimes i don't:
class MyView(View):
table = Table('//locator')
selected = Checkbox(locator='//locator')
flash = FlashMessages('//locator')
file = FileInput(locator='//locator')
message = Text('//locator')
input = TextInput(locator='//locator')
If i knew locator is always third arg - i'd always define my widgets like Text(locator='//locator'). If i knew it's always first - i'd never have to specify locator= at all. Current state of things just provokes to make common mistake and introduces some extra time for debugging :)