Skip to content

Commit 803b1d3

Browse files
author
Krzysztof Wojnar
committed
chore(e2e): disable stylus pop up
1 parent e82c68e commit 803b1d3

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Example/e2e/examplesTests/events.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const awaitClassicalEventBehavior = async () => {
2929
'11. Main | transitionStart | opening',
3030
'12. Main | transitionEnd | opening',
3131
];
32-
for (const expectedEventNotiication of expectedEvents) {
33-
await expect(element(by.text(expectedEventNotiication))).toExist();
32+
for (const expectedEventNotification of expectedEvents) {
33+
await expect(element(by.text(expectedEventNotification))).toExist();
3434
}
3535
};
3636

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { getCommandLineResponse } from "react-native-screens/scripts/e2e/command-line-helpers";
2+
import { device } from 'detox';
3+
4+
export function disableStylusPopupOnAndroid() {
5+
if (device.getPlatform() === 'ios') return;
6+
try {
7+
getCommandLineResponse(`adb -s ${device.id} shell settings put secure stylus_handwriting_enabled 0`);
8+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
9+
} catch (_) {
10+
console.warn('Failed to disable stylus setting.');
11+
}
12+
}

FabricExample/e2e/jest.setup.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { device } from 'detox';
2+
import { disableStylusPopupOnAndroid } from './helpers/disableStylus';
23

34
beforeAll(async () => {
45
await device.launchApp();
6+
disableStylusPopupOnAndroid();
57
});
68

79
afterAll(async () => {

0 commit comments

Comments
 (0)