Files
MyMobileAgent/app/e2e/helpers.js

30 lines
760 B
JavaScript

/**
* Shared Detox helpers for e2e tests.
*/
/**
* Wait for the app to pass the 5-second landing splash and reach MainTabs.
* Call this in beforeAll() after device.launchApp().
*/
async function navigatePastSplash() {
// 1. Splash logo must appear first
await waitFor(element(by.id('landing-logo')))
.toBeVisible()
.withTimeout(10000);
// 2. After the 5-second timer, the app navigates to MainTabs.
// The bottom tab label "Modèles" is the first visible tab bar item.
await waitFor(element(by.text('Modèles')))
.toBeVisible()
.withTimeout(12000);
}
/**
* Tap a bottom tab by its visible label.
*/
async function tapTab(label) {
await element(by.text(label)).tap();
}
module.exports = { navigatePastSplash, tapTab };