packages/expo-updates/e2e/README.md
These instructions are for the E2E (enabled) tests.
# The location of your local copy of this repo
export EXPO_REPO_ROOT=/Users/me/myCode/expo
# The name of a directory that the test project can live under
export WORKING_DIR_ROOT=/Users/me/myCode/e2eworking
# Other environment variables needed for the test setup
export TEST_PROJECT_ROOT=$WORKING_DIR_ROOT/updates-e2e
export UPDATES_HOST=localhost
export UPDATES_PORT=4747
export EXPO_PUBLIC_UPDATES_SERVER_PORT=4747
# Remove and recreate the working directory before executing the setup
rm -rf $WORKING_DIR_ROOT
mkdir $WORKING_DIR_ROOT
Run source <scriptname> to run it and set up the environment variables
From the Expo repo root directory, execute:
./packages/expo-updates/e2e/setup/create-eas-project.ts
Change directory to the TEST_PROJECT_ROOT location with cd $TEST_PROJECT_ROOT.
Execute this command to generate the bundles used by the test server:
# it will generate android and iOS bundles.
yarn generate-test-update-bundles
To run iOS tests:
npx pod-install
yarn maestro:ios:debug:build
./maestro/maestro-test-executor.sh ./maestro/tests/updates-e2e-enabled.yml ios debug
To run Android tests:
yarn maestro:android:debug:build
./maestro/maestro-test-executor.sh ./maestro/tests/updates-e2e-enabled.yml android debug
For either the iOS or Android tests, you can optionally run the test updates server separately for debugging purposes.
./maestro/updates-server/start.ts
This creates a test project that allows you to exercise the Updates API features manually against EAS. The project is set up to use expo-channel-name=main as the EAS update request header.
# The location of your local copy of this repo
export EXPO_REPO_ROOT=/Users/me/myCode/expo
# The name of a directory that the test project can live under
export WORKING_DIR_ROOT=/Users/me/myCode/e2eworking
# The user name of the Expo account you are logged into
export EXPO_ACCOUNT_NAME=myexpoaccount
# Other environment variables needed for the test setup
export TEST_PROJECT_ROOT=$WORKING_DIR_ROOT/MyUpdatesApp
export EX_UPDATES_NATIVE_DEBUG=1
# Remove and recreate the working directory before executing the setup
rm -rf $WORKING_DIR_ROOT
mkdir $WORKING_DIR_ROOT
./packages/expo-updates/e2e/setup/create-updates-test.ts
Change to the test project directory
Execute these commands to set up EAS:
eas init
eas update:configure
npx pod-install # if testing iOS
npx expo run:<ios|android>
eas update and select the default branch (main) and default commit message.