Goal
Get detox tests to run with Travis for an Expo app.
.travis.yml
language: objective-c
osx_image: xcode11.3
env:
global:
- NODE_VERSION=stable
install:
- brew tap wix/brew
- brew install applesimutils
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
- export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- nvm alias default $NODE_VERSION
- npm install -g react-native-cli
- npm install -g detox-cli
- npm install -g expo-cli
- npm install detox
before_script:
- ./setup.sh
script:
- echo 'Starting expo in separate process'
- expo start --ios &
- echo 'Waiting on expo to start in other process and open an ios sim'
- sleep 300
- echo 'Running detox tests'
- detox test --configuration ios.sim --cleanup
Error
The Travis build failed with the following error -
detox[6787] INFO: Example: should have welcome screen [FAIL]
detox[6787] WARN: [Client.js/PENDING_REQUESTS] App has not responded to the network requests below:
(id = 2) invoke: {"target":{"type":"Invocation","value":{"target":{"type":"EarlGrey","value":"instance"},"method":"detox_selectElementWithMatcher:","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"GREYMatchers"},"method":"matcherForAccessibilityID:","args":[{"type":"NSString","value":"firstScreen"}]}}]}},"method":"assertWithMatcher:","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"GREYMatchers"},"method":"matcherForSufficientlyVisible","args":[]}}]}
(id = -1000) isReady: {}
That might be the reason why the test "Example should have welcome screen" has timed out.
FAIL e2e/firstTest.spec.js (367.64s)
Example
✕ should have welcome screen (243561ms)
● Example › should have welcome screen
Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.
In particular, any ideas about the following portion of the above error App has not responded to the network requests below?
Project:
Here is a link to the PR for the project https://github.com/bryanboyko/expo-detox-travis-3/pull/1
Travis Build
Full build logs - https://travis-ci.com/github/bryanboyko/expo-detox-travis-3/builds/152742315
Steps to run detox tests locally
git clone git@github.com:bryanboyko/expo-detox-travis-3.gitcd expo-detox-travis-3git checkout bryan/travisnpm installnpm install -g expo-clibrew tap wix/brewbrew install --HEAD applesimutilsnpm install -g detox-cli./setup.shexpo start --ios &detox test
If possible, push a branch and create a PR to get a travis build going