Skip to content

Commit

Permalink
test: almost making test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Jul 16, 2023
1 parent 0536ce2 commit 74c6901
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/screens/get-started-screen/get-started-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const GetStartedScreen: React.FC = () => {
<Pressable
onPress={() => setSecretMenuCounter(secretMenuCounter + 1)}
style={styles.logoContainer}
{...testProps("logo-button")}
>
<AppLogo width={"100%"} height={"100%"} />
</Pressable>
Expand Down
26 changes: 20 additions & 6 deletions e2e/02-login-flow.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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 })
Expand All @@ -159,7 +173,7 @@ describe("Login Flow", () => {
await emailInput.click()
await emailInput.setValue(email)
await clickButton(LL.EmailRegistrationInitiateScreen.send())
// [email protected]

const emailRes = await getSecondEmail(inboxId)
if (!emailRes) throw new Error("No email response")

Expand Down

0 comments on commit 74c6901

Please sign in to comment.