Skip to content

Commit fdd7f84

Browse files
authored
fix: stable iOS e2e tests (#392)
## 📜 Description Make iOS tests on CI stable again. ## 💡 Motivation and Context Looks like after updating some of runners to XCode 15.3 booting up a simulator takes long time (actually it boots pretty fast, but after that CPU usage is close to 100% for quite big period of time). As a result tests are failing because of timeout. I've tried many things - switching to other XCode versions, increasing timeout, changing the order of tests, changing runners, pre-booting simultator etc. and still tests very flaky in some cases. However what I discovered is that after ~20mins and after several failures tests start to work okay. So I decided to add `--retry 2` flag to overcome the problem of flaky simulator - it makes CI green again. But if a regression really introduced - it'll fail anyway just with linger time of execution 🙂 ## 📢 Changelog ### E2E - added `patch-package`; - updated `detox`; - updated assets; - moved tests preparation in `jest-setup.ts` file; - run tests with retries; - use scroll instead of swipe in `AwareScrollView` test; ### CI - increased `timeout` (60 -> 90); ## 🤔 How Has This Been Tested? Tested on CI. ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
1 parent 6348481 commit fdd7f84

14 files changed

+233
-42
lines changed

.github/workflows/ios-e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
test:
2626
name: ⚙️ Automated test cases
2727
runs-on: macos-14
28-
timeout-minutes: 60
28+
timeout-minutes: 90
2929
env:
3030
WORKING_DIRECTORY: example
3131
concurrency:

e2e/kit/001-keyboard-animation.e2e.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ import {
55
waitForElementById,
66
waitForExpect,
77
} from "./helpers";
8-
import setDemoMode from "./utils/setDemoMode";
98

109
describe("Example", () => {
11-
beforeAll(async () => {
12-
await setDemoMode();
13-
await device.launchApp();
14-
});
15-
1610
it("should navigate to `Animated transition` screen", async () => {
1711
await waitAndTap("animated_transition");
1812
await waitForElementById("keyboard_animation_text_input");

e2e/kit/003-enabled-disabled.e2e.ts renamed to e2e/kit/002-enabled-disabled.e2e.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ import {
66
waitForElementById,
77
waitForExpect,
88
} from "./helpers";
9-
import setDemoMode from "./utils/setDemoMode";
109

1110
describe("Example", () => {
12-
beforeAll(async () => {
13-
await setDemoMode();
14-
await device.launchApp();
15-
});
16-
1711
it("should navigate to `Enabled/disabled` screen", async () => {
1812
await scrollDownUntilElementIsVisible(
1913
"main_scroll_view",

e2e/kit/004-masked-input.e2e.ts renamed to e2e/kit/003-masked-input.e2e.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@ import {
77
waitAndType,
88
waitForElementById,
99
} from "./helpers";
10-
import setDemoMode from "./utils/setDemoMode";
1110

1211
describe("`onTextChange` functionality", () => {
13-
beforeAll(async () => {
14-
await setDemoMode();
15-
await device.launchApp();
16-
});
17-
1812
it("should fire `onTextChange` with correct text", async () => {
1913
await scrollDownUntilElementIsVisible(
2014
"main_scroll_view",

e2e/kit/002-aware-scroll-view.e2e.ts renamed to e2e/kit/004-aware-scroll-view.e2e.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
waitAndType,
88
waitForExpect,
99
} from "./helpers";
10-
import setDemoMode from "./utils/setDemoMode";
1110

1211
const BLINKING_CURSOR = 0.35;
1312

@@ -17,11 +16,6 @@ const closeKeyboard = async () => {
1716
};
1817

1918
describe("AwareScrollView test cases", () => {
20-
beforeAll(async () => {
21-
await setDemoMode();
22-
await device.launchApp();
23-
});
24-
2519
it("should push input above keyboard on focus", async () => {
2620
await waitAndTap("aware_scroll_view");
2721
await waitAndTap("TextInput#3");
@@ -55,7 +49,7 @@ describe("AwareScrollView test cases", () => {
5549
});
5650

5751
it("should auto-scroll when user types a text", async () => {
58-
await element(by.id("TextInput#4")).swipe("down", "slow", 0.15);
52+
await element(by.id("aware_scroll_view_container")).scroll(80, "up");
5953
await typeText("TextInput#4", "1");
6054
await waitForExpect(async () => {
6155
await expectBitmapsToBeEqual(

e2e/kit/005-keyboard-toolbar.e2e.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,8 @@ import {
1111
waitForElementById,
1212
waitForExpect,
1313
} from "./helpers";
14-
import setDemoMode from "./utils/setDemoMode";
1514

1615
describe("`KeyboardToolbar` specification", () => {
17-
beforeAll(async () => {
18-
await setDemoMode();
19-
await device.launchApp();
20-
});
21-
2216
it("should navigate to `Toolbar` screen", async () => {
2317
await scrollDownUntilElementIsVisible("main_scroll_view", "toolbar");
2418
await waitAndTap("toolbar");
-2 Bytes
Loading
1 Byte
Loading
-2 Bytes
Loading
7 Bytes
Loading

0 commit comments

Comments
 (0)