Skip to content

Commit 3c3db41

Browse files
authored
test(e2e, Fabric): add e2e tests for issue/PR examples 702..726 (#2928)
## Description Check which example screens from issues/PRs can be used in e2e testing for tests `Test702, ..., Test726` and implement them if possible for Fabric. ### Test702 Skipped because we can't check animation in any meaningful way. ### Test706 Skipped because we can't check font weight. ### Test713 Skipped because the issue is still present (`transitionStart/End` events are not fired when leaving the screen due to a call from the JS side; the decision was that [this will not be fixed](#713 (comment)) if there is no important use case for it). ### Test726 Test created, only on iOS (original issue was related to iOS). It checks if the app freezes after going back from screen with autofocus input. It is important to note that the issue was reopened with similar, but not the same, bug. ## Changes - add `Test726` e2e test - add testIDs to `Test726` test screen - add comments for every test screen from this PR in `apps/src/tests/index.ts` with the reason for (not) implementing e2e test for it ## Test code and steps to reproduce CI ## Checklist - [ ] Ensured that CI passes
1 parent 4a383a9 commit 3c3db41

3 files changed

Lines changed: 40 additions & 6 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { device, expect, element, by } from 'detox';
2+
import { describeIfiOS } from '../e2e-utils';
3+
4+
// issue related to iOS
5+
describeIfiOS('Test726', () => {
6+
beforeAll(async () => {
7+
await device.reloadReactNative();
8+
});
9+
10+
it('Test726 should exist', async () => {
11+
await waitFor(element(by.id('root-screen-tests-Test726')))
12+
.toBeVisible()
13+
.whileElement(by.id('root-screen-examples-scrollview'))
14+
.scroll(600, 'down', NaN, 0.85);
15+
16+
await expect(element(by.id('root-screen-tests-Test726'))).toBeVisible();
17+
await element(by.id('root-screen-tests-Test726')).tap();
18+
});
19+
20+
it('swiping back should not cause the freeze', async () => {
21+
await expect(element(by.id('test-screen-button-push-me'))).toBeVisible();
22+
await element(by.id('test-screen-button-push-me')).tap();
23+
24+
await expect(element(by.id('test-screen-2-text'))).toBeVisible();
25+
await element(by.id('test-screen-2-view')).swipe('right', 'slow', 0.9, 0.0);
26+
27+
// Check that the app is still responsive by navigating to TestScreen2 again
28+
await expect(element(by.id('test-screen-button-push-me'))).toBeVisible();
29+
await element(by.id('test-screen-button-push-me')).tap();
30+
31+
await expect(element(by.id('test-screen-2-text'))).toBeVisible();
32+
});
33+
});

apps/src/tests/Test726.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ function TestScreen({ navigation }) {
1010
title="PUSH ME"
1111
onPress={() => navigation.push('Test')}
1212
style={styles.button}
13+
testID="test-screen-button-push-me"
1314
/>
1415
</View>
1516
);
1617
}
1718

1819
function TestScreen2() {
1920
return (
20-
<View style={styles.content}>
21-
<Text>Try to swipe back, it will freeze</Text>
21+
<View style={styles.content} testID="test-screen-2-view">
22+
<Text testID="test-screen-2-text">Try to swipe back, it will freeze</Text>
2223
<TextInput autoFocus />
2324
</View>
2425
);

apps/src/tests/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export { default as Test654 } from './Test654'; // [E2E created](iOS): issue
2323
export { default as Test658 } from './Test658'; // [E2E created]
2424
export { default as Test662 } from './Test662'; // [E2E skipped]: can't check animation in a meaningful way
2525
export { default as Test691 } from './Test691'; // [E2E created](iOS): issue related to iOS modal behavior
26-
export { default as Test702 } from './Test702';
27-
export { default as Test706 } from './Test706';
28-
export { default as Test713 } from './Test713';
29-
export { default as Test726 } from './Test726';
26+
export { default as Test702 } from './Test702'; // [E2E skipped]: can't check animation in a meaningful way
27+
export { default as Test706 } from './Test706'; // [E2E skipped]: can't check font weight
28+
export { default as Test713 } from './Test713'; // [E2E skipped]: issue still present
29+
export { default as Test726 } from './Test726'; // [E2E created](iOS): issue related to iOS
3030
export { default as Test748 } from './Test748';
3131
export { default as Test750 } from './Test750';
3232
export { default as Test758 } from './Test758';

0 commit comments

Comments
 (0)