Skip to content

Commit 9baa10b

Browse files
authored
LOOP-4208 Upgrade detox (#82)
* Upgrade detox, and switch to jest-circus * Update detox * Add environment * Add updated applesimutils * Update to available device on circleci * More device name updates * Revert applesimutils update * uitest fixes * Restore html reports * Allow longer time for tests
1 parent 45f98ab commit 9baa10b

File tree

9 files changed

+5637
-16972
lines changed

9 files changed

+5637
-16972
lines changed

e2e/config.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"setupFilesAfterEnv": [
3-
"./init.js"
4-
],
5-
"testEnvironment": "node",
2+
"maxWorkers": 1,
3+
"testEnvironment": "./environment",
4+
"testRunner": "jest-circus/runner",
5+
"testTimeout": 240000,
66
"reporters": [
77
"detox/runners/jest/streamlineReporter",
88
[

e2e/environment.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const {
2+
DetoxCircusEnvironment,
3+
SpecReporter,
4+
WorkerAssignReporter,
5+
} = require('detox/runners/jest-circus');
6+
7+
class CustomDetoxEnvironment extends DetoxCircusEnvironment {
8+
constructor(config, context) {
9+
super(config, context);
10+
11+
// Can be safely removed, if you are content with the default value (=300000ms)
12+
this.initTimeout = 300000;
13+
14+
// This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
15+
// This is strictly optional.
16+
this.registerListeners({
17+
SpecReporter,
18+
WorkerAssignReporter,
19+
});
20+
}
21+
}
22+
23+
module.exports = CustomDetoxEnvironment;
24+

e2e/error_1/error_1.spec.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ describe('errors', () => {
3838
afterAll(async () => {
3939
cgmScreen = await test.OpenCGMScreen();
4040
await cgmScreen.Apply(test.CGMData);
41-
await cgmScreen.DoneButton.tap();
4241
});
4342
it('dimiss signal loss alert', async () => {
4443
await waitFor(cgmScreen.Alert(cgmScreen.generalText.Dismiss)).toBeVisible().withTimeout(2000);
@@ -47,7 +46,7 @@ describe('errors', () => {
4746
});
4847
it('and check error shown on status screen', async () => {
4948
statusScreen = await test.OpenStatusScreen();
50-
expect(statusScreen.HeaderSection.CGMSignalLossLabel).toBeVisible();
49+
await expect(statusScreen.HeaderSection.CGMSignalLossLabel).toBeVisible();
5150
});
5251
});
5352
describe('immediate alert', () => {
@@ -68,7 +67,7 @@ describe('errors', () => {
6867
});
6968
it('and check error shown on status screen', async () => {
7069
let statusScreen = await test.OpenStatusScreen();
71-
expect(statusScreen.HeaderSection.CGMAlertLabel).toBeVisible();
70+
await expect(statusScreen.HeaderSection.CGMAlertLabel).toBeVisible();
7271
});
7372
});
7473
});

e2e/init.js

-33
This file was deleted.

0 commit comments

Comments
 (0)