Zelenium Tests Best Practices
Also look at HowToWriteZeleniumTests (why not merge ?)
High Level Recommendations
- Tests should not rely on previous test runs
- Test should have setUp and tearDown scripts which can prepare and clean up environment respectively
- Test must not contains any hard coded values like user names, organizations, etc ... Instead configuration of former can be moved to a Python script which can be used at test rendering time to dynamically generate test
- Test should use a non manager account but a real ERP5 account so security is taken into account whenever test is run
- Test must be created if feasible in a way so that they can be reused and plugged into a production instance, run in it without modifying production data
- Common code can be grouped into a "library" of macros
Zelenium Hints
- Take care when using 'open' rather than 'openAndWait'. This can cause random test failures whenever only 'open' (fire and go one test execution) is used
- Whenever an ERP5 object is edited always wait for activities
- When you have to use "type" in selenium always assert if all fields and the save button is present, before use any type into one page or any selection. This will prevent the tests become stopped waiting for confirmation in dialog is some action is not possible.