Skip to content

Commit 08a4dac

Browse files
committed
feat(passcodes): release sign in with passcodes to 100% and remove flag/test
1 parent f15302f commit 08a4dac

20 files changed

+90
-108
lines changed

Diff for: cypress/integration/ete/delete.4.cy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('Delete my account flow in Okta', () => {
44
cy.visit(
55
`/signin?returnUrl=${encodeURIComponent(
66
`https://${Cypress.env('BASE_URI')}/welcome/review`,
7-
)}`,
7+
)}&usePasswordSignIn=true`,
88
);
99
cy.get('input[name=email]').type(email);
1010
cy.get('input[name=password]').type(password);

Diff for: cypress/integration/ete/jobs_terms.4.cy.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('Jobs terms and conditions flow in Okta', () => {
1111
})
1212
?.then(({ emailAddress, finalPassword }) => {
1313
const visitUrl =
14-
'/signin?clientId=jobs&returnUrl=https%3A%2F%2Fjobs.theguardian.com%2F';
14+
'/signin?clientId=jobs&returnUrl=https%3A%2F%2Fjobs.theguardian.com%2F&usePasswordSignIn=true';
1515
cy.visit(visitUrl);
1616
cy.get('input[name=email]').type(emailAddress);
1717
cy.get('input[name=password]').type(finalPassword);
@@ -61,7 +61,7 @@ describe('Jobs terms and conditions flow in Okta', () => {
6161
)}/welcome/review`;
6262
const visitUrl = `/signin?returnUrl=${encodeURIComponent(
6363
postSignInReturnUrl,
64-
)}`;
64+
)}&usePasswordSignIn=true`;
6565
cy.visit(visitUrl);
6666
cy.get('input[name=email]').type(emailAddress);
6767
cy.get('input[name=password]').type(finalPassword);
@@ -127,7 +127,7 @@ describe('Jobs terms and conditions flow in Okta', () => {
127127
)}/welcome/review`;
128128
const visitUrl = `/signin?returnUrl=${encodeURIComponent(
129129
postSignInReturnUrl,
130-
)}`;
130+
)}&usePasswordSignIn=true`;
131131
cy.visit(visitUrl);
132132
cy.get('input[name=email]').type(emailAddress);
133133
cy.get('input[name=password]').type(finalPassword);
@@ -179,7 +179,7 @@ describe('Jobs terms and conditions flow in Okta', () => {
179179
)}/welcome/review`;
180180
const visitUrl = `/signin?returnUrl=${encodeURIComponent(
181181
postSignInReturnUrl,
182-
)}`;
182+
)}&usePasswordSignIn=true`;
183183
cy.visit(visitUrl);
184184
cy.get('input[name=email]').type(emailAddress);
185185
cy.get('input[name=password]').type(finalPassword);

Diff for: cypress/integration/ete/new_account_review.3.cy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('New account review page', () => {
7575
cy.url().should('contain', decodeURIComponent(encodedReturnUrl));
7676

7777
// Return to Gateway so we can access the user cookie
78-
cy.visit('/signin');
78+
cy.visit('/signin?usePasswordSignIn=true');
7979
cy.getTestOktaUser(unregisteredEmail).then((user) => {
8080
cy.getTestUserDetails(user.profile.legacyIdentityId).then(
8181
(response) => {
@@ -156,7 +156,7 @@ describe('New account review page', () => {
156156
cy.url().should('contain', decodeURIComponent(encodedReturnUrl));
157157

158158
// Return to Gateway so we can access the user cookie
159-
cy.visit('/signin');
159+
cy.visit('/signin?usePasswordSignIn=true');
160160

161161
// Check that the user does not have their registration location set
162162
cy.getTestOktaUser(unregisteredEmail).then((user) => {

Diff for: cypress/integration/ete/reauthenticate.4.cy.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('Reauthenticate flow, Okta enabled', () => {
77
cy.visit(
88
`/signin?returnUrl=${encodeURIComponent(
99
`https://${Cypress.env('BASE_URI')}/welcome/review`,
10-
)}`,
10+
)}&usePasswordSignIn=true`,
1111
);
1212
cy.get('input[name=email]').type(emailAddress);
1313
cy.get('input[name=password]').type(finalPassword);
@@ -18,7 +18,7 @@ describe('Reauthenticate flow, Okta enabled', () => {
1818
cy.visit(
1919
`/reauthenticate?returnUrl=${encodeURIComponent(
2020
`https://${Cypress.env('BASE_URI')}/welcome/review`,
21-
)}`,
21+
)}&usePasswordSignIn=true`,
2222
);
2323
cy.get('input[name=email]').type(emailAddress);
2424
cy.get('input[name=password]').type(finalPassword);
@@ -47,7 +47,7 @@ describe('Reauthenticate flow, Okta enabled', () => {
4747
cy.visit(
4848
`/signin?returnUrl=${encodeURIComponent(
4949
`https://${Cypress.env('BASE_URI')}/welcome/review`,
50-
)}`,
50+
)}&usePasswordSignIn=true`,
5151
);
5252
cy.get('input[name=email]').type(emailAddressA);
5353
cy.get('input[name=password]').type(finalPasswordA);
@@ -66,7 +66,7 @@ describe('Reauthenticate flow, Okta enabled', () => {
6666
cy.visit(
6767
`/reauthenticate?returnUrl=${encodeURIComponent(
6868
`https://${Cypress.env('BASE_URI')}/welcome/review`,
69-
)}`,
69+
)}&usePasswordSignIn=true`,
7070
);
7171
cy.get('input[name=email]').type(emailAddressB);
7272
cy.get('input[name=password]').type(finalPasswordB);

Diff for: cypress/integration/ete/registration_2.6.cy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ describe('Registration flow - Split 2/2', () => {
610610
cy.visit(
611611
`/signin?returnUrl=${encodeURIComponent(
612612
`https://${Cypress.env('BASE_URI')}/welcome/review`,
613-
)}`,
613+
)}&usePasswordSignIn=true`,
614614
);
615615
cy.get('input[name=email]').type(emailAddress);
616616
cy.get('input[name=password]').type(finalPassword);

Diff for: cypress/integration/ete/registration_newsletter.5.cy.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('Saturday Edition Geolocation', () => {
2323
cy.visit(
2424
`/signin?returnUrl=${encodeURIComponent(
2525
`https://${Cypress.env('BASE_URI')}/welcome/google`,
26-
)}`,
26+
)}&usePasswordSignIn=true`,
2727
);
2828
cy.get('input[name=email]').type(emailAddress);
2929
cy.get('input[name=password]').type(finalPassword);
@@ -55,7 +55,7 @@ describe('Saturday Edition Geolocation', () => {
5555
cy.visit(
5656
`/signin?returnUrl=${encodeURIComponent(
5757
`https://${Cypress.env('BASE_URI')}/welcome/google`,
58-
)}`,
58+
)}&usePasswordSignIn=true`,
5959
);
6060
cy.get('input[name=email]').type(emailAddress);
6161
cy.get('input[name=password]').type(finalPassword);
@@ -87,7 +87,7 @@ describe('Saturday Edition Geolocation', () => {
8787
cy.visit(
8888
`/signin?returnUrl=${encodeURIComponent(
8989
`https://${Cypress.env('BASE_URI')}/welcome/google`,
90-
)}`,
90+
)}&usePasswordSignIn=true`,
9191
);
9292
cy.get('input[name=email]').type(emailAddress);
9393
cy.get('input[name=password]').type(finalPassword);
@@ -118,7 +118,7 @@ describe('Saturday Edition Geolocation', () => {
118118
cy.visit(
119119
`/signin?returnUrl=${encodeURIComponent(
120120
`https://${Cypress.env('BASE_URI')}/welcome/google`,
121-
)}`,
121+
)}&usePasswordSignIn=true`,
122122
);
123123
cy.get('input[name=email]').type(emailAddress);
124124
cy.get('input[name=password]').type(finalPassword);
@@ -148,7 +148,7 @@ describe('Saturday Edition Geolocation', () => {
148148
cy.visit(
149149
`/signin?returnUrl=${encodeURIComponent(
150150
`https://${Cypress.env('BASE_URI')}/welcome/google`,
151-
)}`,
151+
)}&usePasswordSignIn=true`,
152152
);
153153
cy.get('input[name=email]').type(emailAddress);
154154
cy.get('input[name=password]').type(finalPassword);
@@ -176,7 +176,7 @@ describe('Feast newsletter for Feast app', () => {
176176
cy.visit(
177177
`/signin?returnUrl=${encodeURIComponent(
178178
`https://${Cypress.env('BASE_URI')}/welcome/google?appClientId=${app.id}`,
179-
)}`,
179+
)}&usePasswordSignIn=true`,
180180
);
181181
cy.get('input[name=email]').type(emailAddress);
182182
cy.get('input[name=password]').type(finalPassword);
@@ -204,7 +204,7 @@ describe('Feast newsletter for Feast app', () => {
204204
cy.visit(
205205
`/signin?returnUrl=${encodeURIComponent(
206206
`https://${Cypress.env('BASE_URI')}/welcome/google?appClientId=${app.id}`,
207-
)}`,
207+
)}&usePasswordSignIn=true`,
208208
);
209209
cy.get('input[name=email]').type(emailAddress);
210210
cy.get('input[name=password]').type(finalPassword);
@@ -234,7 +234,7 @@ describe('Jobs newsletter for Jobs Site', () => {
234234
cy.visit(
235235
`/signin?returnUrl=${encodeURIComponent(
236236
`https://${Cypress.env('BASE_URI')}/welcome/google?clientId=${clientId}`,
237-
)}`,
237+
)}&usePasswordSignIn=true`,
238238
);
239239
cy.get('input[name=email]').type(emailAddress);
240240
cy.get('input[name=password]').type(finalPassword);

Diff for: cypress/integration/ete/sign_in.1.cy.ts

+24-20
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('Sign in flow, Okta enabled', () => {
8585
cy.url().should('eq', guardianJobsPrivacyPolicyUrl);
8686
});
8787
it('navigates to reset password', () => {
88-
cy.visit('/signin');
88+
cy.visit('/signin?usePasswordSignIn=true');
8989
cy.contains('Reset password').click();
9090
cy.contains('Reset password');
9191
});
@@ -120,7 +120,7 @@ describe('Sign in flow, Okta enabled', () => {
120120
cy.url().should('contain', 'clientId=jobs');
121121
});
122122
it('applies form validation to email and password input fields', () => {
123-
cy.visit('/signin');
123+
cy.visit('/signin?usePasswordSignIn=true');
124124

125125
cy.get('form').within(() => {
126126
cy.get('input:invalid').should('have.length', 2);
@@ -292,7 +292,7 @@ describe('Sign in flow, Okta enabled', () => {
292292
cy.visit(
293293
`/signin?returnUrl=${encodeURIComponent(
294294
`https://${Cypress.env('BASE_URI')}/welcome/review`,
295-
)}`,
295+
)}&usePasswordSignIn=true`,
296296
);
297297
cy.get('input[name=email]').type(emailAddress);
298298
cy.get('input[name=password]').type(finalPassword);
@@ -317,7 +317,7 @@ describe('Sign in flow, Okta enabled', () => {
317317
});
318318
});
319319

320-
context('Okta IDX API Sign In', () => {
320+
context('Okta IDX API Sign In with Password', () => {
321321
it('ACTIVE user - email + password authenticators - successfully sign in', () => {
322322
// Intercept the external redirect page.
323323
// We just want to check that the redirect happens, not that the page loads.
@@ -329,7 +329,7 @@ describe('Sign in flow, Okta enabled', () => {
329329
isUserEmailValidated: true,
330330
})
331331
?.then(({ emailAddress, finalPassword }) => {
332-
cy.visit('/signin');
332+
cy.visit('/signin?usePasswordSignIn=true');
333333
cy.get('input[name=email]').type(emailAddress);
334334
cy.get('input[name=password]').type(finalPassword);
335335
cy.get('[data-cy="main-form-submit-button"]').click();
@@ -348,7 +348,9 @@ describe('Sign in flow, Okta enabled', () => {
348348
isUserEmailValidated: true,
349349
})
350350
?.then(({ emailAddress, finalPassword }) => {
351-
cy.visit(`/signin?returnUrl=${encodeURIComponent(returnUrl)}`);
351+
cy.visit(
352+
`/signin?returnUrl=${encodeURIComponent(returnUrl)}&usePasswordSignIn=true`,
353+
);
352354
cy.get('input[name=email]').type(emailAddress);
353355
cy.get('input[name=password]').type(finalPassword);
354356
cy.get('[data-cy="main-form-submit-button"]').click();
@@ -376,9 +378,11 @@ describe('Sign in flow, Okta enabled', () => {
376378
isUserEmailValidated: true,
377379
})
378380
?.then(({ emailAddress, finalPassword }) => {
379-
cy.visit(`/signin?returnUrl=${encodeURIComponent(returnUrl)}`);
380381
cy.visit(
381-
`/signin?returnUrl=${encodedReturnUrl}&appClientId=${appClientId}&fromURI=${fromURI}`,
382+
`/signin?returnUrl=${encodeURIComponent(returnUrl)}&usePasswordSignIn=true`,
383+
);
384+
cy.visit(
385+
`/signin?returnUrl=${encodedReturnUrl}&appClientId=${appClientId}&fromURI=${fromURI}&usePasswordSignIn=true`,
382386
);
383387
cy.get('input[name=email]').type(emailAddress);
384388
cy.get('input[name=password]').type(finalPassword);
@@ -444,7 +448,7 @@ describe('Sign in flow, Okta enabled', () => {
444448
cy.contains(emailAddress.toLowerCase());
445449

446450
// setup complete, now sign in
447-
cy.visit('/signin');
451+
cy.visit('/signin?usePasswordSignIn=true');
448452
cy.contains('Sign in with a different email').click();
449453
cy.get('input[name=email]').clear().type(emailAddress);
450454
cy.get('input[name=password]').type(password);
@@ -494,7 +498,7 @@ describe('Sign in flow, Okta enabled', () => {
494498
isUserEmailValidated: true,
495499
})
496500
?.then(({ emailAddress, finalPassword }) => {
497-
cy.visit('/signin');
501+
cy.visit('/signin?usePasswordSignIn=true');
498502
cy.get('input[name=email]').type(emailAddress);
499503
cy.get('input[name=password]').type(`${finalPassword}!`);
500504
cy.get('[data-cy="main-form-submit-button"]').click();
@@ -503,7 +507,7 @@ describe('Sign in flow, Okta enabled', () => {
503507
});
504508

505509
it('NON-EXISTENT user - shows authentication error in all scenarios', () => {
506-
cy.visit('/signin');
510+
cy.visit('/signin?usePasswordSignIn=true');
507511
cy.get('input[name=email]').type('[email protected]');
508512
cy.get('input[name=password]').type('password');
509513
cy.get('[data-cy="main-form-submit-button"]').click();
@@ -519,7 +523,7 @@ describe('Sign in flow, Okta enabled', () => {
519523
cy
520524
.createTestUser({ isGuestUser: true })
521525
?.then(({ emailAddress, finalPassword }) => {
522-
cy.visit('/signin');
526+
cy.visit('/signin?usePasswordSignIn=true');
523527
cy.get('input[name=email]').type(emailAddress);
524528
cy.get('input[name=password]').type(`${finalPassword}`);
525529
cy.get('[data-cy="main-form-submit-button"]').click();
@@ -562,7 +566,7 @@ describe('Sign in flow, Okta enabled', () => {
562566
cy.visit(
563567
`/signin?returnUrl=${encodeURIComponent(
564568
`https://${Cypress.env('BASE_URI')}/welcome/review`,
565-
)}`,
569+
)}&usePasswordSignIn=true`,
566570
);
567571
cy.get('input[name=email]').type(emailAddress);
568572
cy.get('input[name=password]').type(finalPassword);
@@ -597,7 +601,7 @@ describe('Sign in flow, Okta enabled', () => {
597601
isUserEmailValidated: true,
598602
})
599603
?.then(({ emailAddress, finalPassword }) => {
600-
cy.visit('/signin');
604+
cy.visit('/signin?usePasswordSignIn=true');
601605

602606
cy.interceptRecaptcha();
603607

@@ -656,7 +660,7 @@ describe('Sign in flow, Okta enabled', () => {
656660
cy.visit(
657661
`/signin?returnUrl=${encodeURIComponent(
658662
`https://${Cypress.env('BASE_URI')}/welcome/review`,
659-
)}`,
663+
)}&usePasswordSignIn=true`,
660664
);
661665
cy.get('input[name=email]').type(emailAddress);
662666
cy.get('input[name=password]').type(finalPassword);
@@ -702,7 +706,7 @@ describe('Sign in flow, Okta enabled', () => {
702706
cy.visit(
703707
`/signin?returnUrl=${encodeURIComponent(
704708
`https://${Cypress.env('BASE_URI')}/welcome/review`,
705-
)}`,
709+
)}&usePasswordSignIn=true`,
706710
);
707711
cy.get('input[name=email]').type(emailAddress);
708712
cy.get('input[name=password]').type(finalPassword);
@@ -748,7 +752,7 @@ describe('Sign in flow, Okta enabled', () => {
748752
cy.visit(
749753
`/signin?returnUrl=${encodeURIComponent(
750754
`https://${Cypress.env('BASE_URI')}/welcome/review`,
751-
)}`,
755+
)}&usePasswordSignIn=true`,
752756
);
753757
cy.get('input[name=email]').type(emailAddress);
754758
cy.get('input[name=password]').type(finalPassword);
@@ -780,7 +784,7 @@ describe('Sign in flow, Okta enabled', () => {
780784
cy.visit(
781785
`/signin?returnUrl=${encodeURIComponent(
782786
`https://${Cypress.env('BASE_URI')}/welcome/review`,
783-
)}`,
787+
)}&usePasswordSignIn=true`,
784788
);
785789
cy.get('input[name=email]').type(emailAddress);
786790
cy.get('input[name=password]').type(finalPassword);
@@ -851,7 +855,7 @@ describe('Sign in flow, Okta enabled', () => {
851855
cy.visit(
852856
`/signin?returnUrl=${encodeURIComponent(
853857
`https://${Cypress.env('BASE_URI')}/welcome/review`,
854-
)}`,
858+
)}&usePasswordSignIn=true`,
855859
);
856860
cy.get('input[name=email]').type(emailAddress);
857861
cy.get('input[name=password]').type(finalPassword);
@@ -912,7 +916,7 @@ describe('Sign in flow, Okta enabled', () => {
912916
)}/welcome/review`;
913917
const visitUrl = `/signin?returnUrl=${encodeURIComponent(
914918
postSignInReturnUrl,
915-
)}`;
919+
)}&usePasswordSignIn=true`;
916920
cy.visit(visitUrl);
917921
cy.get('input[name=email]').type(emailAddress);
918922
cy.get('input[name=password]').type(finalPassword);

Diff for: cypress/integration/ete/sign_out.5.cy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Sign out flow', () => {
1818
)}/welcome/review`;
1919
const visitUrl = `/signin?returnUrl=${encodeURIComponent(
2020
postSignInReturnUrl,
21-
)}`;
21+
)}&usePasswordSignIn=true`;
2222
cy.visit(visitUrl);
2323
cy.get('input[name=email]').type(emailAddress);
2424
cy.get('input[name=password]').type(finalPassword);

Diff for: cypress/integration/mocked/rateLimit.1.cy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('POST requests return a user-facing error message when encountering a rate limit from Okta', () => {
22
specify('Submit /signin', () => {
3-
cy.visit('/signin');
3+
cy.visit('/signin?usePasswordSignIn=true');
44
cy.get('input[name="email"]').type('[email protected]');
55
cy.get('input[name="password"]').type('password');
66

@@ -16,7 +16,7 @@ describe('POST requests return a user-facing error message when encountering a r
1616
});
1717

1818
specify('Submit /reauthenticate', () => {
19-
cy.visit('/reauthenticate');
19+
cy.visit('/reauthenticate?usePasswordSignIn=true');
2020
cy.get('input[name="email"]').type('[email protected]');
2121
cy.get('input[name="password"]').type('password');
2222

0 commit comments

Comments
 (0)