...
- Create a feature file.
- Create an empty class for a step definitions
- The test case covers 3 application screens. The Main Screen, Switch Account Screen, Add Account Screen. Let's create a classes for them. As we want to cover both OS we have to create abstract classes first.
There will be 3 abstract classes:
- MainScreen.java
- SwitchAccountScreen.java
- AddAccountScreen.java
- Each class should contain the needed methods and should extend the base Screen class from AQ Test Framework - Mobile. The classes should looks as the following.
- As the test case is for Android we have to create an implementation of the abstract classes for the Android which should contain the exact UI actions.
There will be 3 classes with the exact implementations:
- AndroidMainScreen.java
- AndroidSwitchAccountScreen.java
- AndroidAddAccountScreen.java
- Here is and example of AndroidSwitchAccountScreen.java. All the other classes would be pretty similar the main difference is UI element and actions under them.
- As you see we reuse all the needed UI element and actions from the AQ Test Framework - Mobile
- The only thing we need is to add the logic to the methods in the empty class for a step definitions. It should look like the following:
How to execute test cases:
Manual local run on emulator for Android:
- Checkout the source code (master) https://github.com/NYPL-Simplified/integration-tests-android
- Open the solution in IntelliJ IDEA and build
- Create a virtual device (e.g using AVD in android studio), run it and get its name (adb.exe devices)
- Go to Recourses→ Open settings.json → Set isRemote to False → Set platformName as android → Set the path to the SimplyE.apk to "app" in driverSettings section for android (e.g "./src/test/resources/simplye-5.0.10-50010-debug.apk") → Open devices.json and change the deviceName
- Open any *.feature file → Right click on any Scenario → Click "Run <scenario_name>"
Manual remote run on BrowserStack for iOS from IDE:
- Checkout the source code (master) https://github.com/NYPL-Simplified/integration-tests-android
- Open the solution in IntelliJ IDEA and build
- Go to Recourses→ Open settings.json → Set isRemote to True → Set platformName as ios → Set the remoteConnectionUrl to http://<username>:<AccessKey>@hub.browserstack.com/wd/hub → Set the BS path to the SimplyE.apk to "app" in driverSettings section for ios (e.g "bs://00a1cd05ebe4deaf3a84bccb6de216e6a100b645")
- Open any *.feature file → Right click on any Scenario → Click "Run <scenario_name>"
- Go to BS → App Automate → have a look how the test is executing
Manual run using GitHub Actions:
Automatic run using GitHub Actions: