lettuce_webdriver
lettuce_webdriver copied to clipboard
Internationalization
Hi, Lettuce supports multiple languages. lettuce_webdriver should support those languages too. Or at least, defining new translations should not duplicate the webdriver logic (for now I copied webdriver.py steps to my terrain.py file and translated the steps).
Here is my current workaround to avoid duplicating code. Any better solution is welcome. ... something like in my terrain.py file (indentations do not appear):
@step('je devrais voir "([^"]+)"$') def should_see(step, text): for regex, func in STEP_REGISTRY.items(): matched = (regex == r'I should see "([^"]+)"$') if matched: func(step, text) break