@@ -26,14 +26,15 @@ import {
2626 assertNoSTComponents ,
2727 generateState ,
2828 clickOnProviderButton ,
29- loginWithAuth0 ,
29+ loginWithMockProvider ,
3030 getGeneralError ,
3131 waitFor ,
3232 screenshotOnFailure ,
3333 clickOnProviderButtonWithoutWaiting ,
3434 backendBeforeEach ,
3535 waitForUrl ,
3636 setupBrowser ,
37+ loginWithAuth0 ,
3738} from "../helpers" ;
3839
3940import { TEST_CLIENT_BASE_URL , TEST_SERVER_BASE_URL , SIGN_IN_UP_API , GET_AUTH_URL_API } from "../constants" ;
@@ -137,37 +138,37 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs,
137138 ] ) ;
138139 } ) ;
139140
140- it ( "Successful sign in with Auth0 with redirectToPath (w/ leading slash) keeping query params" , async function ( ) {
141+ it ( "Successful sign in with redirectToPath (w/ leading slash) keeping query params" , async function ( ) {
141142 await Promise . all ( [
142143 page . goto ( `${ TEST_CLIENT_BASE_URL } /auth?redirectToPath=%2Fredirect-here%3Ffoo%3Dbar` ) ,
143144 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
144145 ] ) ;
145146 await assertProviders ( page ) ;
146- await clickOnProviderButton ( page , "Auth0 " ) ;
147+ await clickOnProviderButton ( page , "Mock Provider " ) ;
147148 await Promise . all ( [
148- loginWithAuth0 ( page ) ,
149+ loginWithMockProvider ( page ) ,
149150 page . waitForResponse ( ( response ) => response . url ( ) === SIGN_IN_UP_API && response . status ( ) === 200 ) ,
150151 ] ) ;
151152 const { pathname, search } = await page . evaluate ( ( ) => window . location ) ;
152153 assert . deepStrictEqual ( pathname + search , "/redirect-here?foo=bar" ) ;
153154 } ) ;
154155
155- it ( "Successful sign in with Auth0 with redirectToPath (w/o leading slash) keeping query params" , async function ( ) {
156+ it ( "Successful sign in with SSO with redirectToPath (w/o leading slash) keeping query params" , async function ( ) {
156157 await Promise . all ( [
157158 page . goto ( `${ TEST_CLIENT_BASE_URL } /auth?redirectToPath=%3Ffoo%3Dbar` ) ,
158159 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
159160 ] ) ;
160161 await assertProviders ( page ) ;
161- await clickOnProviderButton ( page , "Auth0 " ) ;
162+ await clickOnProviderButton ( page , "Mock Provider " ) ;
162163 await Promise . all ( [
163- loginWithAuth0 ( page ) ,
164+ loginWithMockProvider ( page ) ,
164165 page . waitForResponse ( ( response ) => response . url ( ) === SIGN_IN_UP_API && response . status ( ) === 200 ) ,
165166 ] ) ;
166167 const { pathname, search } = await page . evaluate ( ( ) => window . location ) ;
167168 assert . deepStrictEqual ( pathname + search , "/?foo=bar" ) ;
168169 } ) ;
169170
170- it ( "Successful sign in with Auth0 with redirectToPath (query params + fragment)" , async function ( ) {
171+ it ( "Successful sign in with SSO with redirectToPath (query params + fragment)" , async function ( ) {
171172 await Promise . all ( [
172173 page . goto (
173174 `${ TEST_CLIENT_BASE_URL } /auth?redirectToPath=${ encodeURIComponent (
@@ -177,39 +178,39 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs,
177178 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
178179 ] ) ;
179180 await assertProviders ( page ) ;
180- await clickOnProviderButton ( page , "Auth0 " ) ;
181+ await clickOnProviderButton ( page , "Mock Provider " ) ;
181182 await Promise . all ( [
182- loginWithAuth0 ( page ) ,
183+ loginWithMockProvider ( page ) ,
183184 page . waitForResponse ( ( response ) => response . url ( ) === SIGN_IN_UP_API && response . status ( ) === 200 ) ,
184185 ] ) ;
185186 const { pathname, search, hash } = await page . evaluate ( ( ) => window . location ) ;
186187 assert . deepStrictEqual ( pathname + search + hash , "/redirect-here?foo=bar#cell=4,1-6,2" ) ;
187188 } ) ;
188189
189- it ( "Successful sign in with Auth0 with redirectToPath (only fragment)" , async function ( ) {
190+ it ( "Successful sign in with SSO with redirectToPath (only fragment)" , async function ( ) {
190191 await Promise . all ( [
191192 page . goto ( `${ TEST_CLIENT_BASE_URL } /auth?redirectToPath=${ encodeURIComponent ( "#cell=4,1-6,2" ) } ` ) ,
192193 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
193194 ] ) ;
194195 await assertProviders ( page ) ;
195- await clickOnProviderButton ( page , "Auth0 " ) ;
196+ await clickOnProviderButton ( page , "Mock Provider " ) ;
196197 await Promise . all ( [
197- loginWithAuth0 ( page ) ,
198+ loginWithMockProvider ( page ) ,
198199 page . waitForResponse ( ( response ) => response . url ( ) === SIGN_IN_UP_API && response . status ( ) === 200 ) ,
199200 ] ) ;
200201 const { pathname, search, hash } = await page . evaluate ( ( ) => window . location ) ;
201202 assert . deepStrictEqual ( pathname + search + hash , "/#cell=4,1-6,2" ) ;
202203 } ) ;
203204
204- it ( "Successful signin with Auth0 and email verification" , async function ( ) {
205+ it ( "Successful signin with SSO and email verification" , async function ( ) {
205206 await Promise . all ( [
206207 page . goto ( `${ TEST_CLIENT_BASE_URL } /auth?mode=REQUIRED` ) ,
207208 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
208209 ] ) ;
209210 await assertProviders ( page ) ;
210- await clickOnProviderButton ( page , "Auth0 " ) ;
211+ await clickOnProviderButton ( page , "Mock Provider " ) ;
211212 await Promise . all ( [
212- loginWithAuth0 ( page ) ,
213+ loginWithMockProvider ( page ) ,
213214 page . waitForResponse ( ( response ) => response . url ( ) === SIGN_IN_UP_API && response . status ( ) === 200 ) ,
214215 ] ) ;
215216 await page . waitForSelector ( ".sessionInfo-user-id" ) ;
@@ -241,48 +242,51 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs,
241242 ] ) ;
242243 } ) ;
243244
244- it ( "Successful signin with auth0 and redirectToPath" , async function ( ) {
245+ it ( "Successful signin with SSO and redirectToPath" , async function ( ) {
245246 await Promise . all ( [
246247 page . goto ( `${ TEST_CLIENT_BASE_URL } /auth?redirectToPath=/hello` ) ,
247248 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
248249 ] ) ;
249250 await assertProviders ( page ) ;
250- await clickOnProviderButton ( page , "Auth0 " ) ;
251+ await clickOnProviderButton ( page , "Mock Provider " ) ;
251252 await Promise . all ( [
252- loginWithAuth0 ( page ) ,
253+ loginWithMockProvider ( page ) ,
253254 page . waitForResponse ( ( response ) => response . url ( ) === SIGN_IN_UP_API && response . status ( ) === 200 ) ,
254255 ] ) ;
255256 await waitForUrl ( page , "/hello" ) ;
256257 } ) ;
257258
258- it ( "Successful signin with auth0 and redirectToPath case sensitive" , async function ( ) {
259+ it ( "Successful signin with SSO and redirectToPath case sensitive" , async function ( ) {
259260 await Promise . all ( [
260261 page . goto ( `${ TEST_CLIENT_BASE_URL } /auth?redirectToPath=%2FCasE%2FCase-SensItive1-PAth` ) ,
261262 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
262263 ] ) ;
263264 await assertProviders ( page ) ;
264- await clickOnProviderButton ( page , "Auth0 " ) ;
265+ await clickOnProviderButton ( page , "Mock Provider " ) ;
265266 await Promise . all ( [
266- loginWithAuth0 ( page ) ,
267+ loginWithMockProvider ( page ) ,
267268 page . waitForResponse ( ( response ) => response . url ( ) === SIGN_IN_UP_API && response . status ( ) === 200 ) ,
268269 ] ) ;
269270 await waitForUrl ( page , "/CasE/Case-SensItive1-PAth" ) ;
270271 } ) ;
271272
272273 it ( "should work with custom getRedirectUrl" , async function ( ) {
273274 await page . evaluate ( ( TEST_CLIENT_BASE_URL ) => {
274- localStorage . setItem ( "thirdPartyRedirectURL" , `${ TEST_CLIENT_BASE_URL } /auth/auth0-custom-redirect` ) ;
275+ localStorage . setItem (
276+ "thirdPartyRedirectURL" ,
277+ `${ TEST_CLIENT_BASE_URL } /auth/mock-provider-custom-redirect`
278+ ) ;
275279 } , TEST_CLIENT_BASE_URL ) ;
276280
277281 await Promise . all ( [
278282 page . goto ( `${ TEST_CLIENT_BASE_URL } /auth?redirectToPath=/hello` ) ,
279283 page . waitForNavigation ( { waitUntil : "networkidle0" } ) ,
280284 ] ) ;
281285 await assertProviders ( page ) ;
282- await clickOnProviderButton ( page , "Auth0 " ) ;
283- await loginWithAuth0 ( page ) ;
286+ await clickOnProviderButton ( page , "Mock Provider " ) ;
287+ await loginWithMockProvider ( page ) ;
284288
285- await waitForUrl ( page , "/auth/auth0 -custom-redirect" ) ;
289+ await waitForUrl ( page , "/auth/mock-provider -custom-redirect" ) ;
286290 } ) ;
287291
288292 // it("Successful signin with facebook", async function () {
@@ -354,8 +358,8 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs,
354358 }
355359 } ;
356360 page . on ( "request" , requestHandler ) ;
357- await clickOnProviderButton ( page , "Auth0 " ) ;
358- await loginWithAuth0 ( page ) ;
361+ await clickOnProviderButton ( page , "Mock Provider " ) ;
362+ await loginWithMockProvider ( page ) ;
359363 const error = await getGeneralError ( page ) ;
360364 assert . deepStrictEqual ( error , "TOS" ) ;
361365 } ) ;
@@ -390,8 +394,8 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs,
390394 } ;
391395 page . on ( "request" , requestHandler ) ;
392396
393- await clickOnProviderButton ( page , "Auth0 " ) ;
394- await loginWithAuth0 ( page ) ;
397+ await clickOnProviderButton ( page , "Mock Provider " ) ;
398+ await loginWithMockProvider ( page ) ;
395399
396400 const error = await getGeneralError ( page ) ;
397401 assert . deepStrictEqual ( error , "Test message!!!!" ) ;
0 commit comments