h3. Why? We want to have some guideline how to write E2E automated tests on templates.
h3. What? Have a automated test running against one of our templates (mobile security template) probably. Have it well documented with internal docs as well as MD file in the repository.
h3. How? Use [appium|http://appium.io/], it was proven to be well working through Appium Java SDK (AGDROID-675). Write a set of base / helper classes that tests will inherit from.
Use PageObjects as [~thnolan] recommended: Page objects are a great way of abstracting the presentation logic and removing it from the test code. Page objects allow us to expose the selectors to other classes from their own class, and also can be used to provide some basic user actions, such as click a button or send text to a text area (call methods from the utility class). as a general rule of thumb, page objects generally don't have assertion logic in our code. He is an example of somebody using page objects in java. https://www.pluralsight.com/guides/software-engineering-best-practices/getting-started-with-page-object-pattern-for-your-selenium-tests
Recommendations by [~vsazel]: Use Kotlin and it's DSL capabilities to have tests understandable and without boilerplate. Something like that:
{code:Groovy} on applicationScreen {
openNavigationDrawer { select(authentication) }
on authenticationScreen { //authenticationScreen is that page object click(login) on keycloakLoginScreen { fill(username,"user1") fill(password,"123") click(login) //this login would be different from login above, it would be from context of keycloakLoginScreen } }
on authenticatedScreen { //... } } {code}
and/or use specification framework like [Spek|http://spekframework.org/docs/latest/#_styles] |
|