This code was created based on https://medium.com/@7ynk3r/react-native-e2e-testing-with-appium-on-sauce-labs-8920195b8a54
- Install all depedencies:
yarn
- Create the release versions
- iOS:
react-native run-ios --configuration Release
- Android:
react-native run-android --variant=release
- iOS:
- Create an account in Sauce Labs
- Get your user name and access key at https://saucelabs.com/beta/user-settings
- Create
secret.json
at the root level with
{
"YOUR_SAUCE_USERNAME": "[USER_NAME]",
"YOUR_SAUCE_ACCESS_KEY": "[USER_ACCESS_KEY]"
}
- Update
test-config/capabilities.js
with the absoluteapp
paths for each platform. - Start the appium server:
yarn appium
- [Android] Start an Android device (make sure is visible using
adb
). - Run the tests
- iOS:
TEST_CONFIG=local_ios yarn test
- Android:
TEST_CONFIG=local_android yarn test
- iOS:
- Upload the apps to Sauce Labs
curl -u "[USER_NAME]:[USER_ACCESS_KEY]" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/[USER_NAME]/[APP_NAME].apk?overwrite=true --data-binary @[ABSOLUTE_APP_BUILD_PATH]
- Verify that uploaded apps
curl -u "[USER_NAME]:[USER_ACCESS_KEY]" https://saucelabs.com/rest/v1/storage/[USER_NAME]
- Update
test-config/capabilities.js
with theapp
paths for each platform. - Run the tests
- iOS:
TEST_CONFIG=remote_ios yarn test
- Android:
TEST_CONFIG=remote_android yarn test
- iOS: