Цель
Получите детокс-тесты для запуска вместе с Travis для приложения Expo.
.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
Ошибка
Сбой сборки Travis со следующей ошибкой -
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.
В частности, любые идеи о следующей части вышеуказанной ошибки App has not responded to the network requests below
?
Проект:
Вот ссылка на PR для проекта https://github.com/bryanboyko/expo-detox-travis-3/pull/1
Travis Build
Полные журналы сборки - https://travis-ci.com/github/bryanboyko/expo-detox-travis-3/builds/152742315
Шаги для локального проведения детокс-тестов
git clone git@github.com:bryanboyko/expo-detox-travis-3.git
cd expo-detox-travis-3
git checkout bryan/travis
npm install
npm install -g expo-cli
brew tap wix/brew
brew install --HEAD applesimutils
npm install -g detox-cli
./setup.sh
expo start --ios &
detox test
Если возможно, сделайте пу sh ветку и создайте PR, чтобы начать сборку travis