forked from react-navigation/react-navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
322 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
|
||
name: Detox (iOS) | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
timeout-minutes: 15 | ||
|
||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_11.2.app | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Use Node.js 10 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Get Yarn cache | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Cache Yarn packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-yarn- | ||
|
||
- name: Install dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Cache Pods | ||
uses: actions/cache@v1 | ||
with: | ||
path: example/ios/Pods | ||
key: pods-${{ hashFiles('**/Podfile.lock') }} | ||
|
||
- name: Update Pods | ||
run: | | ||
gem update cocoapods xcodeproj | ||
cd example/ios | ||
pod install | ||
- name: Configure dependencies | ||
run: | | ||
brew tap wix/brew | ||
brew install applesimutils | ||
yarn global add detox-cli | ||
- name: Cache Detox build | ||
uses: actions/cache@v1 | ||
id: detox-cache | ||
with: | ||
path: example/ios/build | ||
key: detox-build-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/Podfile.lock') }} | ||
|
||
- name: Build Detox | ||
if: steps.detox-cache.outputs.cache-hit != 'true' | ||
run: | | ||
cd example | ||
detox build --configuration ios.sim.release | ||
- name: Run Detox tests | ||
run: | | ||
cd example | ||
detox test --configuration ios.sim.release --cleanup --debug-synchronization 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { by, element, expect, device } from 'detox'; | ||
|
||
beforeEach(async () => { | ||
await device.reloadReactNative(); | ||
}); | ||
|
||
it('has dark theme toggle', async () => { | ||
await expect(element(by.text('Dark theme'))).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"setupFilesAfterEnv": ["./init.js"], | ||
"testEnvironment": "node", | ||
"reporters": ["detox/runners/jest/streamlineReporter"], | ||
"verbose": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* eslint-disable import/no-commonjs, jest/no-jasmine-globals */ | ||
/* eslint-env jest, jasmine */ | ||
|
||
const detox = require('detox'); | ||
const config = require('../package.json').detox; | ||
const adapter = require('detox/runners/jest/adapter'); | ||
const specReporter = require('detox/runners/jest/specReporter'); | ||
|
||
// Set the default timeout | ||
jest.setTimeout(120000); | ||
|
||
jasmine.getEnv().addReporter(adapter); | ||
|
||
// This takes care of generating status logs on a per-spec basis. By default, jest only reports at file-level. | ||
// This is strictly optional. | ||
jasmine.getEnv().addReporter(specReporter); | ||
|
||
beforeAll(async () => { | ||
await detox.init(config); | ||
}, 300000); | ||
|
||
beforeEach(async () => { | ||
await adapter.beforeEach(); | ||
}); | ||
|
||
afterAll(async () => { | ||
await adapter.afterAll(); | ||
await detox.cleanup(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.