Skip to content

Commit 65fcec7

Browse files
committed
Stabilize connect tests
1 parent 9aa888a commit 65fcec7

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

packages/tests-e2e/src/connect/scenarios/append.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ test.describe('append flows', () => {
6363
// First attempt to create passkey is cancelled, user skips, then sets up TOTP and logs in later
6464
await virtualAuthenticator.modeCancel();
6565
const postLoginPage = await signupPage.submit(email, TestDataFactory.phoneNumber, TestDataFactory.password);
66+
await postLoginPage.awaitPage();
6667
const mfaPage = await postLoginPage.skipAfterSignup();
6768

6869
// Confirm TOTP to end on profile

packages/tests-e2e/src/connect/scenarios/login.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ test.describe('login flows', () => {
3030

3131
const email = TestDataFactory.generateEmail();
3232
const postLoginPage = await signupPage.submit(email, TestDataFactory.phoneNumber, TestDataFactory.password);
33+
await postLoginPage.awaitPage();
3334
const profilePage = await postLoginPage.continue(true);
3435
await profilePage.awaitPage();
3536

@@ -54,6 +55,7 @@ test.describe('login flows', () => {
5455

5556
const email = TestDataFactory.generateEmail();
5657
const postLoginPage = await signupPage.submit(email, TestDataFactory.phoneNumber, TestDataFactory.password);
58+
await postLoginPage.awaitPage();
5759
const profilePage = await postLoginPage.continue(true);
5860
await profilePage.awaitPage();
5961
const loginPage2 = await profilePage.logout();
@@ -79,6 +81,7 @@ test.describe('login flows', () => {
7981

8082
const email = TestDataFactory.generateEmail();
8183
const postLoginPage = await signupPage.submit(email, TestDataFactory.phoneNumber, TestDataFactory.password);
84+
await postLoginPage.awaitPage();
8285
const profilePage = await postLoginPage.continue(true);
8386
await profilePage.awaitPage();
8487

@@ -133,6 +136,7 @@ test.describe('login flows', () => {
133136

134137
const email = TestDataFactory.generateEmail();
135138
const postLoginPage = await signupPage.submit(email, TestDataFactory.phoneNumber, TestDataFactory.password);
139+
await postLoginPage.awaitPage();
136140
const profilePage = await postLoginPage.continue(true);
137141
await profilePage.awaitPage();
138142
expect(await profilePage.awaitState(ProfileStatus.ListWithPasskeys)).toBeTruthy();

packages/tests-e2e/src/connect/scenarios/network-blocking.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ test.describe('network blocking flows', () => {
3232

3333
const email = TestDataFactory.generateEmail();
3434
const postLoginPage = await signupPage.submit(email, TestDataFactory.phoneNumber, TestDataFactory.password);
35+
await postLoginPage.awaitPage();
3536
const profilePage = await postLoginPage.continue(true);
3637
await profilePage.awaitPage();
3738

@@ -78,13 +79,15 @@ test.describe('network blocking flows', () => {
7879
await networkBlocker.appendStart();
7980
const loginPage2 = await profilePage.logout();
8081
await loginPage2.loginWithIdentifierAndPasswordIdentifierFirst(email, TestDataFactory.password);
82+
expect(await loginPage2.awaitState(LoginStatus.FallbackSecondTOTP)).toBeTruthy();
8183
const codeFirst = await authenticator.getCode(sharedKey);
8284
const postLoginPage2 = await loginPage2.completeLoginWithTOTP(codeFirst!);
8385
await postLoginPage2.autoSkip().awaitPage();
8486

8587
await networkBlocker.appendFinish();
8688
const loginPage3 = await profilePage.logout();
8789
await loginPage3.loginWithIdentifierAndPasswordIdentifierFirst(email, TestDataFactory.password);
90+
expect(await loginPage2.awaitState(LoginStatus.FallbackSecondTOTP)).toBeTruthy();
8891
const codeSecond = await authenticator.getCode(sharedKey);
8992
const postLoginPage3 = await loginPage3.completeLoginWithTOTP(codeSecond!);
9093
await postLoginPage3.autoSkip().awaitPage();
@@ -100,6 +103,7 @@ test.describe('network blocking flows', () => {
100103

101104
const email = TestDataFactory.generateEmail();
102105
const postLoginPage = await signupPage.submit(email, TestDataFactory.phoneNumber, TestDataFactory.password);
106+
await postLoginPage.awaitPage();
103107
const profilePage = await postLoginPage.continue(true);
104108
await profilePage.awaitPage();
105109
expect(await profilePage.awaitState(ProfileStatus.ListWithPasskeys)).toBeTruthy();

0 commit comments

Comments
 (0)