Skip to content

Commit 00390cb

Browse files
committed
fix(tests): update functional tests to wait for pairing page
1 parent af6ef24 commit 00390cb

8 files changed

Lines changed: 18 additions & 6 deletions

File tree

packages/functional-tests/tests/cms/cms-2fa.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ test.describe('severity-1 #smoke', () => {
570570
submitButton = page.getByRole('button', { name: 'Sign in', exact: true });
571571
await submitButton.click();
572572

573+
await page.waitForURL(/pair/);
574+
573575
await page.getByRole('link', { name: 'Not now' }).click();
574576

575577
// Verify successful login and go to settings
@@ -647,6 +649,8 @@ test.describe('severity-1 #smoke', () => {
647649
const totpCode = await getTotpCode(secret);
648650
await signinTotpCode.fillOutCodeForm(totpCode);
649651

652+
await page.waitForURL(/pair/);
653+
650654
await page.getByRole('link', { name: 'Not now' }).click();
651655

652656
// Verify successful login

packages/functional-tests/tests/cms/cms.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ test.describe('severity-1 #smoke', () => {
368368
});
369369
await submitButton.click();
370370

371+
await page.waitForURL(/pair/);
372+
371373
await page.getByRole('link', { name: 'Not now' }).click();
372374
});
373375

@@ -442,6 +444,8 @@ test.describe('severity-1 #smoke', () => {
442444
});
443445
await submitButton.click();
444446

447+
await page.waitForURL(/pair/);
448+
445449
await page.getByRole('link', { name: 'Not now', exact: true }).click();
446450
});
447451
});

packages/functional-tests/tests/key-stretching-v2/signInTokenCode.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test.describe('severity-2 #smoke', () => {
4444
const code = await target.emailClient.getVerifyLoginCode(email);
4545
await signinTokenCode.fillOutCodeForm(code);
4646

47-
await expect(page).toHaveURL(/pair/);
47+
await page.waitForURL(/pair/);
4848
await connectAnotherDevice.clickNotNowPair();
4949

5050
await expect(page).toHaveURL(/settings/);

packages/functional-tests/tests/react-conversion/signInConnectAnotherDevice.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test.describe('severity-2 #smoke', () => {
2020
await signin.fillOutEmailFirstForm(credentials.email);
2121
await signin.fillOutPasswordForm(credentials.password);
2222

23-
await expect(page).toHaveURL(/pair/);
23+
await page.waitForURL(/pair/);
2424
await expect(connectAnotherDevice.fxaConnected).toBeVisible();
2525
});
2626
});

packages/functional-tests/tests/react-conversion/signInRelyingParties.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ test.describe('severity-1 #smoke', () => {
2121
await signin.fillOutEmailFirstForm(credentials.email);
2222
await signin.fillOutPasswordForm(credentials.password);
2323

24+
await page.waitForURL(/pair/);
25+
2426
await expect(connectAnotherDevice.fxaConnected).toBeEnabled();
2527
await connectAnotherDevice.clickNotNowPair();
2628
await expect(page).toHaveURL(/settings/);

packages/functional-tests/tests/react-conversion/signinTotp.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ test.describe('severity-1 #smoke', () => {
9090
const totpCode = await getTotpCode(secret);
9191
await signinTotpCode.fillOutCodeForm(totpCode);
9292

93-
await expect(page).toHaveURL(/pair/);
93+
await page.waitForURL(/pair/);
9494

9595
await expect(connectAnotherDevice.fxaConnected).toBeVisible();
9696

packages/functional-tests/tests/react-conversion/syncV3SignIn.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { expect, test } from '../../lib/fixtures/standard';
77
test.describe('severity-2 #smoke', () => {
88
test.describe('Firefox Desktop Sync v3 signin react', () => {
99
test('verified, does not need to confirm', async ({
10-
syncBrowserPages: { connectAnotherDevice, signin },
10+
syncBrowserPages: { connectAnotherDevice, signin, page },
1111
testAccountTracker,
1212
}) => {
1313
const credentials = await testAccountTracker.signUp();
@@ -20,6 +20,8 @@ test.describe('severity-2 #smoke', () => {
2020
await signin.fillOutEmailFirstForm(credentials.email);
2121
await signin.fillOutPasswordForm(credentials.password);
2222

23+
await page.waitForURL(/pair/);
24+
2325
await expect(connectAnotherDevice.fxaConnected).toBeEnabled();
2426
});
2527
});
@@ -46,6 +48,6 @@ test.describe('severity-2 #smoke', () => {
4648

4749
await signinTokenCode.fillOutCodeForm(code);
4850

49-
await expect(page).toHaveURL(/pair/);
51+
await page.waitForURL(/pair/);
5052
});
5153
});

packages/functional-tests/tests/signin/connectAnotherDevice.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test.describe('severity-2 #smoke', () => {
1919
await signin.fillOutEmailFirstForm(credentials.email);
2020
await signin.fillOutPasswordForm(credentials.password);
2121

22-
await expect(page).toHaveURL(/pair/);
22+
await page.waitForURL(/pair/);
2323
await expect(connectAnotherDevice.fxaConnected).toBeVisible();
2424
});
2525
});

0 commit comments

Comments
 (0)