Skip to content

Commit

Permalink
ci: upgrade detox, new config test
Browse files Browse the repository at this point in the history
  • Loading branch information
oscb committed Dec 12, 2023
1 parent dd257e4 commit 0007ab1
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.3.1
xcode-version: latest-stable
- name: Install applesimutils
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
Expand Down
7 changes: 5 additions & 2 deletions examples/E2E-73/.detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ module.exports = {
testRunner: {
args: {
'$0': 'jest',
config: 'e2e/jest.config.js'
config: 'e2e/jest.config.js',
forceExit: process.env.CI ? true : undefined,
},
jest: {
setupTimeout: 120000
}
},
detached: !!process.env.CI,
retries: 3
},
behavior: {
init: {
Expand Down
43 changes: 2 additions & 41 deletions examples/E2E-73/e2e/main.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,6 @@ const { element, by, device } = require('detox');

import { startServer, stopServer } from './mockServer';
import { setupMatchers } from './matchers';
import { retry } from 'ts-retry-promise'

const launchApp = async (
launchArgs = {
newInstance: true,
launchArgs: {
detoxPrintBusyIdleResources: 'YES',
},
}
) => {
await retry(
async () => {
try {
await device.launchApp(launchArgs)
} catch (error) {
error.message = `Failed to launch app with error: ${error.message}`
throw error
}
},
{ retries: 5, delay: 10 * 1000, timeout: 30 * 10000 }
).then(async () => {
await device.setURLBlacklist(['.*blockchain-api-dot-celo-mobile-alfajores.*'])
})
}

const reloadReactNative = async () => {
await retry(
async () => {
try {
await device.reloadReactNative()
} catch (error) {
// eslint-disable-next-line no-console
console.error('Failed to reload react native with error', error)
await launchApp()
}
},
{ retries: 5, delay: 10 * 1000, timeout: 30 * 10000 }
)
}

describe('#mainTest', () => {
const mockServerListener = jest.fn();
Expand All @@ -55,7 +16,7 @@ describe('#mainTest', () => {

beforeAll(async () => {
await startServer(mockServerListener);
await launchApp();
await device.launchApp();
setupMatchers();
});

Expand All @@ -68,7 +29,7 @@ describe('#mainTest', () => {

beforeEach(async () => {
mockServerListener.mockReset();
await reloadReactNative();
device.reloadReactNative();
});

afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/E2E-73/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"babel-plugin-module-resolver": "^5.0.0",
"detox": "^20.13.5",
"detox": "^20.14.1",
"eslint": "^8.19.0",
"express": "^4.17.1",
"jest": "^29.7.0",
Expand Down
10 changes: 5 additions & 5 deletions examples/E2E-73/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3079,7 +3079,7 @@ __metadata:
"@types/react-test-renderer": "npm:^18.0.0"
babel-jest: "npm:^29.6.3"
babel-plugin-module-resolver: "npm:^5.0.0"
detox: "npm:^20.13.5"
detox: "npm:^20.14.1"
eslint: "npm:^8.19.0"
express: "npm:^4.17.1"
jest: "npm:^29.7.0"
Expand Down Expand Up @@ -4453,9 +4453,9 @@ __metadata:
languageName: node
linkType: hard

"detox@npm:^20.13.5":
version: 20.13.5
resolution: "detox@npm:20.13.5"
"detox@npm:^20.14.1":
version: 20.14.1
resolution: "detox@npm:20.14.1"
dependencies:
ajv: "npm:^8.6.3"
bunyan: "npm:^1.8.12"
Expand Down Expand Up @@ -4498,7 +4498,7 @@ __metadata:
optional: true
bin:
detox: local-cli/cli.js
checksum: c2ec6ab83b4055dbe5c7bd494854e94e727b24fc5fa51b6db9184576e41a7502b041c7e54613082e67acf6d4bdcc2ee363f4394e163ede2431575bc02739fd7a
checksum: 17fa6c2917c095870997ddbcc81368476acbb5a011c2eb8e983e744025d34ffac112450d99724c211159b368cf9a5376c23c44a3fd45b930273690f204c3794b
languageName: node
linkType: hard

Expand Down
7 changes: 5 additions & 2 deletions examples/E2E/.detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ module.exports = {
testRunner: {
args: {
'$0': 'jest',
config: 'e2e/jest.config.js'
config: 'e2e/jest.config.js',
forceExit: process.env.CI ? true : undefined,
},
jest: {
setupTimeout: 120000
}
},
detached: !!process.env.CI,
retries: 3
},
behavior: {
init: {
Expand Down
43 changes: 2 additions & 41 deletions examples/E2E/e2e/main.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,6 @@ const { element, by, device } = require('detox');

import { startServer, stopServer } from './mockServer';
import { setupMatchers } from './matchers';
import { retry } from 'ts-retry-promise'

const launchApp = async (
launchArgs = {
newInstance: true,
launchArgs: {
detoxPrintBusyIdleResources: 'YES',
},
}
) => {
await retry(
async () => {
try {
await device.launchApp(launchArgs)
} catch (error) {
error.message = `Failed to launch app with error: ${error.message}`
throw error
}
},
{ retries: 5, delay: 10 * 1000, timeout: 30 * 10000 }
).then(async () => {
await device.setURLBlacklist(['.*blockchain-api-dot-celo-mobile-alfajores.*'])
})
}

const reloadReactNative = async () => {
await retry(
async () => {
try {
await device.reloadReactNative()
} catch (error) {
// eslint-disable-next-line no-console
console.error('Failed to reload react native with error', error)
await launchApp()
}
},
{ retries: 5, delay: 10 * 1000, timeout: 30 * 10000 }
)
}

describe('#mainTest', () => {
const mockServerListener = jest.fn();
Expand All @@ -55,7 +16,7 @@ describe('#mainTest', () => {

beforeAll(async () => {
await startServer(mockServerListener);
await launchApp();
await device.launchApp();
setupMatchers();
});

Expand All @@ -68,7 +29,7 @@ describe('#mainTest', () => {

beforeEach(async () => {
mockServerListener.mockReset();
await reloadReactNative();
device.reloadReactNative();
});

afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/E2E/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"babel-jest": "^29.2.1",
"babel-plugin-module-resolver": "^5.0.0",
"body-parser": "^1.20.0",
"detox": "^20.13.5",
"detox": "^20.14.1",
"eslint": "^8.19.0",
"express": "^4.17.1",
"jest": "^29.7.0",
Expand Down
82 changes: 9 additions & 73 deletions examples/E2E/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1602,15 +1602,6 @@ __metadata:
languageName: node
linkType: hard

"@babel/runtime@npm:^7.21.0":
version: 7.23.5
resolution: "@babel/runtime@npm:7.23.5"
dependencies:
regenerator-runtime: "npm:^0.14.0"
checksum: ca679cc91bb7e424bc2db87bb58cc3b06ade916b9adb21fbbdc43e54cdaacb3eea201ceba2a0464b11d2eb65b9fe6a6ffcf4d7521fa52994f19be96f1af14788
languageName: node
linkType: hard

"@babel/template@npm:^7.0.0, @babel/template@npm:^7.22.15, @babel/template@npm:^7.3.3":
version: 7.22.15
resolution: "@babel/template@npm:7.22.15"
Expand Down Expand Up @@ -2959,8 +2950,7 @@ __metadata:
babel-jest: "npm:^29.2.1"
babel-plugin-module-resolver: "npm:^5.0.0"
body-parser: "npm:^1.20.0"
concurrently: "npm:^8.2.2"
detox: "npm:^20.13.5"
detox: "npm:^20.14.1"
eslint: "npm:^8.19.0"
express: "npm:^4.17.1"
jest: "npm:^29.7.0"
Expand Down Expand Up @@ -4075,26 +4065,6 @@ __metadata:
languageName: node
linkType: hard

"concurrently@npm:^8.2.2":
version: 8.2.2
resolution: "concurrently@npm:8.2.2"
dependencies:
chalk: "npm:^4.1.2"
date-fns: "npm:^2.30.0"
lodash: "npm:^4.17.21"
rxjs: "npm:^7.8.1"
shell-quote: "npm:^1.8.1"
spawn-command: "npm:0.0.2"
supports-color: "npm:^8.1.1"
tree-kill: "npm:^1.2.2"
yargs: "npm:^17.7.2"
bin:
conc: dist/bin/concurrently.js
concurrently: dist/bin/concurrently.js
checksum: 0e9683196fe9c071d944345d21d8f34aa6c0cc50c0dd897e95619f2f1c9eb4871dca851b2569da17888235b7335b4c821ca19deed35bebcd9a131ee5d247f34c
languageName: node
linkType: hard

"connect@npm:^3.6.5":
version: 3.7.0
resolution: "connect@npm:3.7.0"
Expand Down Expand Up @@ -4217,15 +4187,6 @@ __metadata:
languageName: node
linkType: hard

"date-fns@npm:^2.30.0":
version: 2.30.0
resolution: "date-fns@npm:2.30.0"
dependencies:
"@babel/runtime": "npm:^7.21.0"
checksum: e4b521fbf22bc8c3db332bbfb7b094fd3e7627de0259a9d17c7551e2d2702608a7307a449206065916538e384f37b181565447ce2637ae09828427aed9cb5581
languageName: node
linkType: hard

"dayjs@npm:^1.8.15":
version: 1.11.10
resolution: "dayjs@npm:1.11.10"
Expand Down Expand Up @@ -4371,9 +4332,9 @@ __metadata:
languageName: node
linkType: hard

"detox@npm:^20.13.5":
version: 20.13.5
resolution: "detox@npm:20.13.5"
"detox@npm:^20.14.1":
version: 20.14.1
resolution: "detox@npm:20.14.1"
dependencies:
ajv: "npm:^8.6.3"
bunyan: "npm:^1.8.12"
Expand Down Expand Up @@ -4416,7 +4377,7 @@ __metadata:
optional: true
bin:
detox: local-cli/cli.js
checksum: c2ec6ab83b4055dbe5c7bd494854e94e727b24fc5fa51b6db9184576e41a7502b041c7e54613082e67acf6d4bdcc2ee363f4394e163ede2431575bc02739fd7a
checksum: 17fa6c2917c095870997ddbcc81368476acbb5a011c2eb8e983e744025d34ffac112450d99724c211159b368cf9a5376c23c44a3fd45b930273690f204c3794b
languageName: node
linkType: hard

Expand Down Expand Up @@ -9194,15 +9155,6 @@ __metadata:
languageName: node
linkType: hard

"rxjs@npm:^7.8.1":
version: 7.8.1
resolution: "rxjs@npm:7.8.1"
dependencies:
tslib: "npm:^2.1.0"
checksum: 3c49c1ecd66170b175c9cacf5cef67f8914dcbc7cd0162855538d365c83fea631167cacb644b3ce533b2ea0e9a4d0b12175186985f89d75abe73dbd8f7f06f68
languageName: node
linkType: hard

"safe-array-concat@npm:^1.0.1":
version: 1.0.1
resolution: "safe-array-concat@npm:1.0.1"
Expand Down Expand Up @@ -9421,7 +9373,7 @@ __metadata:
languageName: node
linkType: hard

"shell-quote@npm:^1.6.1, shell-quote@npm:^1.7.2, shell-quote@npm:^1.7.3, shell-quote@npm:^1.8.1":
"shell-quote@npm:^1.6.1, shell-quote@npm:^1.7.2, shell-quote@npm:^1.7.3":
version: 1.8.1
resolution: "shell-quote@npm:1.8.1"
checksum: 8cec6fd827bad74d0a49347057d40dfea1e01f12a6123bf82c4649f3ef152fc2bc6d6176e6376bffcd205d9d0ccb4f1f9acae889384d20baff92186f01ea455a
Expand Down Expand Up @@ -9556,13 +9508,6 @@ __metadata:
languageName: node
linkType: hard

"spawn-command@npm:0.0.2":
version: 0.0.2
resolution: "spawn-command@npm:0.0.2"
checksum: b22f2d71239e6e628a400831861ba747750bbb40c0a53323754cf7b84330b73d81e40ff1f9055e6d1971818679510208a9302e13d9ff3b32feb67e74d7a1b3ef
languageName: node
linkType: hard

"split-on-first@npm:^1.0.0":
version: 1.1.0
resolution: "split-on-first@npm:1.1.0"
Expand Down Expand Up @@ -9835,7 +9780,7 @@ __metadata:
languageName: node
linkType: hard

"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1":
"supports-color@npm:^8.0.0":
version: 8.1.1
resolution: "supports-color@npm:8.1.1"
dependencies:
Expand Down Expand Up @@ -9995,15 +9940,6 @@ __metadata:
languageName: node
linkType: hard

"tree-kill@npm:^1.2.2":
version: 1.2.2
resolution: "tree-kill@npm:1.2.2"
bin:
tree-kill: cli.js
checksum: 7b1b7c7f17608a8f8d20a162e7957ac1ef6cd1636db1aba92f4e072dc31818c2ff0efac1e3d91064ede67ed5dc57c565420531a8134090a12ac10cf792ab14d2
languageName: node
linkType: hard

"truncate-utf8-bytes@npm:^1.0.0":
version: 1.0.2
resolution: "truncate-utf8-bytes@npm:1.0.2"
Expand Down Expand Up @@ -10060,7 +9996,7 @@ __metadata:
languageName: node
linkType: hard

"tslib@npm:^2.0.1, tslib@npm:^2.1.0":
"tslib@npm:^2.0.1":
version: 2.6.2
resolution: "tslib@npm:2.6.2"
checksum: e03a8a4271152c8b26604ed45535954c0a45296e32445b4b87f8a5abdb2421f40b59b4ca437c4346af0f28179780d604094eb64546bee2019d903d01c6c19bdb
Expand Down Expand Up @@ -10718,7 +10654,7 @@ __metadata:
languageName: node
linkType: hard

"yargs@npm:^17.0.0, yargs@npm:^17.3.1, yargs@npm:^17.6.2, yargs@npm:^17.7.2":
"yargs@npm:^17.0.0, yargs@npm:^17.3.1, yargs@npm:^17.6.2":
version: 17.7.2
resolution: "yargs@npm:17.7.2"
dependencies:
Expand Down
Loading

0 comments on commit 0007ab1

Please sign in to comment.