diff options
| -rw-r--r-- | gui/test/e2e/installed/state-dependent/login.spec.ts | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/gui/test/e2e/installed/state-dependent/login.spec.ts b/gui/test/e2e/installed/state-dependent/login.spec.ts index 45444715bb..ba72a5b466 100644 --- a/gui/test/e2e/installed/state-dependent/login.spec.ts +++ b/gui/test/e2e/installed/state-dependent/login.spec.ts @@ -49,12 +49,12 @@ test('App should create account', async () => { const title = page.locator('h1') const subtitle = page.getByTestId('subtitle'); - await page.getByText('Create account').click(); + expect(await util.waitForNavigation(async () => { + await page.getByText('Create account').click(); - await expect(title).toHaveText('Account created'); - await expect(subtitle).toHaveText('Logged in'); - - expect(await util.waitForNavigation()).toEqual(RoutePath.expired); + await expect(title).toHaveText('Account created'); + await expect(subtitle).toHaveText('Logged in'); + })).toEqual(RoutePath.expired); const outOfTimeTitle = page.getByTestId('title'); await expect(outOfTimeTitle).toHaveText('Congrats!'); @@ -80,13 +80,14 @@ test('App should log in', async () => { await expect(title).toHaveText('Login'); await expect(subtitle).toHaveText('Enter your account number'); - await loginInput.type(process.env.ACCOUNT_NUMBER!); - await loginInput.press('Enter'); + await loginInput.fill(process.env.ACCOUNT_NUMBER!); - await expect(title).toHaveText('Logged in'); - await expect(subtitle).toHaveText('Valid account number'); + expect(await util.waitForNavigation(async () => { + await loginInput.press('Enter'); - expect(await util.waitForNavigation()).toEqual(RoutePath.main); + await expect(title).toHaveText('Logged in'); + await expect(subtitle).toHaveText('Valid account number'); + })).toEqual(RoutePath.main); await expectDisconnected(page); }); @@ -115,13 +116,11 @@ test('App should log in to expired account', async () => { await expect(title).toHaveText('Login'); await expect(subtitle).toHaveText('Enter your account number'); - await loginInput.type(accountNumber); - await loginInput.press('Enter'); - - await expect(title).toHaveText('Logged in'); - await expect(subtitle).toHaveText('Valid account number'); + await loginInput.fill(accountNumber); - expect(await util.waitForNavigation()).toEqual(RoutePath.expired); + expect(await util.waitForNavigation(async () => { + await loginInput.press('Enter'); + })).toEqual(RoutePath.expired); const outOfTimeTitle = page.getByTestId('title'); await expect(outOfTimeTitle).toHaveText('Out of time'); |
