XCUITest is not the preferred automation framework for React Native applications, but it can be used as can be seen here. The examples written in this repository are used for this XCUITest demo repository.
The purpose of having these tests in this repo is not to show how to write XCUITest tests, but to have an example for running XCUITest tests on Sauce Labs based on the same demo app that we use for Appium tests.
To build an XCUITest debug build and test app you need to execute the following
- Go to the root of this project
- Make sure you are using
yarn
version 1 - Run
yarn ios.xcuitest
This will result in the following logs
╭─ …/Git/SwagLabsMobileApp
╰> yarn ios.xcuitest
yarn run v1.22.10
$ cd scripts && ./build_xcuitest.sh && cd ..
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build-for-testing -configuration Release -workspace SwagLabsMobileApp.xcworkspace -sdk iphoneos -scheme SwagLabsMobileApp -derivedDataPath XCUITestOutput
User defaults from command line:
IDEDerivedDataPathOverride = /Users/Sauce/Git/SwagLabsMobileApp/ios/XCUITestOutput
// ......
** TEST BUILD SUCCEEDED **
Then you can find the app (SwagLabsMobileApp.app
) and the test app (SwagLabsMobileAppUITests-Runner.app
) in this
./ios/XCUITestOutput/Build/Products/Release-iphoneos/
-folder.
Follow the steps on the Sauce Labs Wiki to start running on Sauce Labs or check our this repository which holds some configuration examples.