Make the WebDriver API :
- more consistent
- currently we have a mix of instance method, static methods, helpers ...
- make names consistent
- remove duplicate methodes
- we have several methods for doing the same work
Add 2 static helpers :
- Locator : to locate element
- Locator.findElement(by) : does not wait
- Locator.waitUntilElementPresent(by) : : does wait
- Locator.waitUntilElementNotPresent(by) : : does wait
- Locator.waitUntilTextPresent(by, tx) : : does wait
- Locator.waitUntilTextNotPresent(by, tx) : : does wait
- Assert : to manage assertions
- Assert.hasElement(by)
- Assert.isTextPresent(String)
- Assert.isTextPresent(by, String)
All wait methods should rely on FluentWait instead of using clocks.
Once this is done, some tests will have to be rewritten to conform to this new way of doing things, and some pages/elements (especially layout elements) could be refactored to extend WebFragment instead of extending AbstractPage (that will be stripped of most of its methods).
Also the users and passwords should be common variables to avoid errors "invalid username or password" when order of tests changes.