-
Notifications
You must be signed in to change notification settings - Fork 58
Getting started with UI tests
We use appium combined with SauceLabs as an on-device testing solution for covering writing flows using Gutenberg blocks.
iOS: Once you've already set up XCode and the simulators you should be good to go to run the tests on an iOS simulator.
Android: You'll need to have created the emulator images and fired up the desired emulator before running the tests against an Android emulator.
TBA
One of the Caveats to using Appium is the need for the Appium server to be running to interact with the Simulator or Device through Webdriver, as a result the appium server will need to be started before running the tests. To make the entire process easier in the beforeAll
block of the tests an Appium instance is fired up on a default port of 4723. If you already have something running on that port and would rather not stop that you can change the port within the code that starts that up. At the moment that port number is referenced from the config located at __device-tests__/helpers/serverConfigs.js
. The process is killed in the afterAll
block but some errors might cause it not to get there so it might be best
Appium uses a config object usually referenced to as desired capabilities to connect to a simulator or device, these objects are currently located in __device-tests__/helpers/caps.js
and then referenced when firing up the driver. There are two values that I think are important to know and that's
-
platformVersion
which is the platform version of a connected adb device. -
app
which is the absolute path to the.app
or.apk
file or the path relative to the Appium root. At the moment when running locally, these both point to the debug version of the app used after runningyarn android
oryarn ios
for the respective platform.