Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QAA-370][Detox] Update Detox for full react native 0.75 compatibility #8789

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions apps/ledger-live-mobile/e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,30 @@ const MAX_PORT = 65535;
let portCounter = BASE_PORT; // Counter for generating unique ports
const speculosDevices: [number, SpeculosDevice][] = [];

function sync_delay(ms: number) {
const done = new Int32Array(new SharedArrayBuffer(4));
Atomics.wait(done, 0, 0, ms); // Wait for the specified duration
export async function waitForElementById(id: string | RegExp, timeout: number = DEFAULT_TIMEOUT) {
return await waitFor(getElementById(id)).toBeVisible().withTimeout(timeout);
}

export function waitForElementById(id: string | RegExp, timeout: number = DEFAULT_TIMEOUT) {
return waitFor(element(by.id(id)))
.toBeVisible()
.withTimeout(timeout);
}

export function waitForElementByText(text: string | RegExp, timeout: number = DEFAULT_TIMEOUT) {
return waitFor(element(by.text(text)))
.toBeVisible()
.withTimeout(timeout);
export async function waitForElementByText(
text: string | RegExp,
timeout: number = DEFAULT_TIMEOUT,
) {
return await waitFor(getElementByText(text)).toBeVisible().withTimeout(timeout);
}

export function getElementById(id: string | RegExp, index = 0) {
if (!isAndroid()) sync_delay(200); // Issue with RN75 : QAA-370
return element(by.id(id)).atIndex(index);
}

export function getElementByText(text: string | RegExp, index = 0) {
if (!isAndroid()) sync_delay(200); // Issue with RN75 : QAA-370
return element(by.text(text)).atIndex(index);
}

export function getWebElementById(id: string, index = 0) {
if (!isAndroid()) sync_delay(200); // Issue with RN75 : QAA-370
return web.element(by.web.id(id)).atIndex(index);
}

export function getWebElementByTag(tag: string, index = 0) {
if (!isAndroid()) sync_delay(200); // Issue with RN75 : QAA-370
return web.element(by.web.tag(tag)).atIndex(index);
}

Expand Down Expand Up @@ -108,7 +98,6 @@ async function performScroll(
const scrollViewMatcher = scrollViewId
? by.id(scrollViewId)
: by.type(isAndroid() ? "android.widget.ScrollView" : "RCTScrollView");
if (!isAndroid()) sync_delay(200); // Issue with RN75 : QAA-370
await waitFor(element(elementMatcher))
.toBeVisible()
.whileElement(scrollViewMatcher)
Expand Down
16 changes: 8 additions & 8 deletions apps/ledger-live-mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,7 @@ PODS:
- React-Core
- RNReactNativeHapticFeedback (2.2.0):
- React-Core
- RNReanimated (3.16.1):
- RNReanimated (3.16.6):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1894,10 +1894,10 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated (= 3.16.1)
- RNReanimated/worklets (= 3.16.1)
- RNReanimated/reanimated (= 3.16.6)
- RNReanimated/worklets (= 3.16.6)
- Yoga
- RNReanimated/reanimated (3.16.1):
- RNReanimated/reanimated (3.16.6):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1917,9 +1917,9 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated/apple (= 3.16.1)
- RNReanimated/reanimated/apple (= 3.16.6)
- Yoga
- RNReanimated/reanimated/apple (3.16.1):
- RNReanimated/reanimated/apple (3.16.6):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1940,7 +1940,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNReanimated/worklets (3.16.1):
- RNReanimated/worklets (3.16.6):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2574,7 +2574,7 @@ SPEC CHECKSUMS:
RNKeychain: f75b8c8b2f17d3b2aa1f25b4a0ac5b83d947ff8f
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9
RNReanimated: 82b558efb00a30a3b8ea1a3ca8975125e9400313
RNReanimated: ab90ac44d3255a69b98b8b7773bd2f87f9d8465f
RNScreens: 63500b789c1b5286972a55d4a7d73fc1123f51e4
RNSentry: e7e5d059d62d6c447d83e14800edc1812a594a5d
RNShare: b674d9f1cb0dc11116983bebd8712908a226a3ee
Expand Down
4 changes: 2 additions & 2 deletions apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"react-native-pager-view": "6.5.1",
"react-native-qrcode-svg": "6.1.1",
"react-native-randombytes": "3.6.1",
"react-native-reanimated": "3.16.1",
"react-native-reanimated": "3.16.6",
"react-native-restart": "0.0.24",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.33.0",
Expand Down Expand Up @@ -277,7 +277,7 @@
"babel-jest": "29.7.0",
"body-parser": "1.20.3",
"cors": "2.8.5",
"detox": "20.28.0",
"detox": "20.31.0",
"detox-allure2-adapter": "1.0.0-alpha.12",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-detox": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"detox@20.28.0": "patches/detox@20.28.0.patch",
"detox@20.31.0": "patches/detox@20.31.0.patch",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"@hashgraph/[email protected]": "patches/@[email protected]",
Expand Down
File renamed without changes.
Loading
Loading