Python framework for automated testing with a bit of Behavior-Driven Development via Lettuce (http://lettuce.it) and Selenium RC.
- Configure System Under Test in framework/system/system.cfg.
- Add users (if necessary) in framework/users/users.cfg.
- Write page objects in framework/pages dir.
- Create a feature in features/ directory.
- Write step definitions in features/step_definitions directory.
- Run with
lettuce
!
Test fixture, setUp() and tearDown() for tests are defined in features/terrain.py. Take a look at it.
It's recommended to store locators in separate .cfg file. You can after call LocatorsParser().parse_locators(file, sections) to parse the locators file. For example, you want to create page object for SearchPage. You create directory pages/searcpage and define SearchPage class in __init__py. You also make "from framework.pages import LocatorsParser". In constructor of your class you just call parse_locators() method.
In most Page-Object pattern you pass selenium instance as an argument to page class constructor. And you access it like "self.selenium". In Crescent, you otherwise pass "world" as an argument to page class constructor. Thus, access to Selenium is like "self.world.selenium".