Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a feature file.

  2. Create an empty class for a step definitions

  3. 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
  4. 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.



  5. 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
  6. 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.


  7. As you see we reuse all the needed UI element and actions from the AQ Test Framework - Mobile
  8. 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:

  1. Checkout the source code (master) https://github.com/NYPL-Simplified/integration-tests-android
  2. Open the solution in IntelliJ IDEA and build
  3. Create a virtual device (e.g using AVD in android studio), run it and get its name (adb.exe devices)
  4. 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
  5. Open any *.feature file → Right click on any Scenario → Click "Run <scenario_name>"

Manual remote run on BrowserStack for iOS from IDE:

  1. Checkout the source code (master) https://github.com/NYPL-Simplified/integration-tests-android
  2. Open the solution in IntelliJ IDEA and build
  3. 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")
  4. Open any *.feature file → Right click on any Scenario → Click "Run <scenario_name>"
  5. Go to BS → App Automate → have a look how the test is executing

Manual run using GitHub Actions:


Automatic run using GitHub Actions: