(text, timeout = 33000)
| 44 | } |
| 45 | |
| 46 | export async function waitForText(text, timeout = 33000) { |
| 47 | const callsite = captureCallsite(waitForText); |
| 48 | try { |
| 49 | await waitFor(element(by.text(text))) |
| 50 | .toBeVisible() |
| 51 | .withTimeout(timeout / 2); |
| 52 | return true; |
| 53 | } catch (_) { |
| 54 | // nop |
| 55 | } |
| 56 | |
| 57 | try { |
| 58 | await waitFor(element(by.text(text))) |
| 59 | .toBeVisible() |
| 60 | .withTimeout(timeout / 2); |
| 61 | } catch (err) { |
| 62 | rethrowWithCallsite(err, callsite); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /** Waits for `accessibilityLabel` (Detox `by.label`), e.g. full address while UI text is multiline. */ |
| 67 | export async function waitForLabel(label, timeout = 33000) { |
no test coverage detected