From 74c6901f4fe943f94c485a655adad4bb67cf362f Mon Sep 17 00:00:00 2001 From: Nicolas Burtey Date: Fri, 14 Jul 2023 21:49:00 +0100 Subject: [PATCH] test: almost making test pass --- .../get-started-screen/get-started-screen.tsx | 1 + e2e/02-login-flow.e2e.spec.ts | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/screens/get-started-screen/get-started-screen.tsx b/app/screens/get-started-screen/get-started-screen.tsx index 53f705a14a..cd5ff32a16 100644 --- a/app/screens/get-started-screen/get-started-screen.tsx +++ b/app/screens/get-started-screen/get-started-screen.tsx @@ -85,6 +85,7 @@ export const GetStartedScreen: React.FC = () => { setSecretMenuCounter(secretMenuCounter + 1)} style={styles.logoContainer} + {...testProps("logo-button")} > diff --git a/e2e/02-login-flow.e2e.spec.ts b/e2e/02-login-flow.e2e.spec.ts index 05b9a24a51..afe91a45cd 100644 --- a/e2e/02-login-flow.e2e.spec.ts +++ b/e2e/02-login-flow.e2e.spec.ts @@ -1,4 +1,3 @@ -import { sleep } from "../app/utils/sleep" import { i18nObject } from "../app/i18n/i18n-util" import { loadLocale } from "../app/i18n/i18n-util.sync" import { @@ -134,19 +133,34 @@ describe("Login Flow", () => { it("log out", async () => { await clickOnSetting(LL.AccountScreen.logOutAndDeleteLocalData()) - await sleep(1000) - const iUnderstandButton = await $(selector(LL.AccountScreen.IUnderstand(), "Button")) await iUnderstandButton.waitForDisplayed({ timeout }) await iUnderstandButton.click() - await sleep(1000) - const okButton = await $(selector(LL.common.ok(), "Button")) await okButton.waitForDisplayed({ timeout }) await okButton.click() }) + it("set staging environment again", async () => { + const buildButton = await $(selector("logo-button", "Other")) + await buildButton.waitForDisplayed({ timeout }) + await buildButton.click() + await browser.pause(100) + await buildButton.click() + await browser.pause(100) + await buildButton.click() + await browser.pause(100) + + // scroll down for small screens + await waitTillButtonDisplayed("logout button") + await scrollDown() + await clickButton("Staging Button") + await clickButton("Save Changes") + + await clickBackButton() + }) + it("log back in", async () => { const emailLink = await $(selector("email-button", "Other")) await emailLink.waitForDisplayed({ timeout }) @@ -159,7 +173,7 @@ describe("Login Flow", () => { await emailInput.click() await emailInput.setValue(email) await clickButton(LL.EmailRegistrationInitiateScreen.send()) - // i9TEikJakmv4@mailslurp.com + const emailRes = await getSecondEmail(inboxId) if (!emailRes) throw new Error("No email response")