From 26097c27fec43bac9c5652545bc44fa14aa89747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mih=C3=A1ly=20Lengyel?= Date: Mon, 25 Nov 2024 23:58:32 +0100 Subject: [PATCH] test: switch to mock provider (#866) * test: switch most thirdparty test to use mock provider * test: fix test errors --- examples/for-tests-react-16/src/App.js | 78 +++++++++--------- examples/for-tests/src/App.js | 80 ++++++++++--------- test/end-to-end/generalerror.test.js | 8 +- test/end-to-end/getRedirectionURL.test.js | 20 ++--- ...multitenancy.dynamic_login_methods.test.js | 3 +- test/end-to-end/thirdparty.test.js | 53 ++++++------ .../thirdpartyemailpassword.test.js | 14 ++-- .../end-to-end/thirdpartypasswordless.test.js | 8 +- .../thirdpartypasswordless.tp.test.js | 2 +- test/end-to-end/userContext.test.js | 3 +- test/helpers.js | 17 ++++ 11 files changed, 155 insertions(+), 131 deletions(-) diff --git a/examples/for-tests-react-16/src/App.js b/examples/for-tests-react-16/src/App.js index 321720262..3f3faf383 100644 --- a/examples/for-tests-react-16/src/App.js +++ b/examples/for-tests-react-16/src/App.js @@ -283,47 +283,49 @@ if (testContext.enableMFA) { ); } -SuperTokens.init({ - usesDynamicLoginMethods: testContext.usesDynamicLoginMethods, - clientType: testContext.clientType, - appInfo: { - appName: "SuperTokens", - websiteDomain: getWebsiteDomain(), - apiDomain: getApiDomain(), - websiteBasePath, - }, - languageTranslations: { - translations: { - en: { - PWLESS_SIGN_IN_UP_FOOTER_TOS: "TOS", - }, - hu: { - PWLESS_SIGN_IN_UP_FOOTER_TOS: "ÁSZF", +if (!window.location.pathname.startsWith("/mockProvider")) { + SuperTokens.init({ + usesDynamicLoginMethods: testContext.usesDynamicLoginMethods, + clientType: testContext.clientType, + appInfo: { + appName: "SuperTokens", + websiteDomain: getWebsiteDomain(), + apiDomain: getApiDomain(), + websiteBasePath, + }, + languageTranslations: { + translations: { + en: { + PWLESS_SIGN_IN_UP_FOOTER_TOS: "TOS", + }, + hu: { + PWLESS_SIGN_IN_UP_FOOTER_TOS: "ÁSZF", + }, }, }, - }, - getRedirectionURL: (context) => { - if (context.action === "SUCCESS") { - let logId = { - emailpassword: "EMAIL_PASSWORD", - thirdparty: "THIRD_PARTY", - passwordless: "PASSWORDLESS", - thirdpartypasswordless: "THIRDPARTYPASSWORDLESS", - thirdpartyemailpassword: "THIRD_PARTY_EMAIL_PASSWORD", - }[context.recipeId]; - - console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`); - setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser); - if (testContext.disableRedirectionAfterSuccessfulSignInUp) { - return null; + getRedirectionURL: (context) => { + if (context.action === "SUCCESS") { + let logId = { + emailpassword: "EMAIL_PASSWORD", + thirdparty: "THIRD_PARTY", + passwordless: "PASSWORDLESS", + thirdpartypasswordless: "THIRDPARTYPASSWORDLESS", + thirdpartyemailpassword: "THIRD_PARTY_EMAIL_PASSWORD", + }[context.recipeId]; + + console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`); + setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser); + if (testContext.disableRedirectionAfterSuccessfulSignInUp) { + return null; + } + return context.redirectToPath || "/dashboard"; + } else { + console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`); } - return context.redirectToPath || "/dashboard"; - } else { - console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`); - } - }, - recipeList, -}); + }, + recipeList, + }); +} /* App */ function App() { diff --git a/examples/for-tests/src/App.js b/examples/for-tests/src/App.js index 9b28b6d16..dff22759c 100644 --- a/examples/for-tests/src/App.js +++ b/examples/for-tests/src/App.js @@ -459,48 +459,50 @@ if (testContext.enableMFA) { ); } -SuperTokens.init({ - usesDynamicLoginMethods: testContext.usesDynamicLoginMethods, - clientType: testContext.clientType, - appInfo: { - appName: "SuperTokens", - websiteDomain: getWebsiteDomain(), - apiDomain: getApiDomain(), - websiteBasePath, - }, - languageTranslations: { - translations: { - en: { - PWLESS_SIGN_IN_UP_FOOTER_TOS: "TOS", - }, - hu: { - PWLESS_SIGN_IN_UP_FOOTER_TOS: "ÁSZF", +if (!window.location.pathname.startsWith("/mockProvider")) { + SuperTokens.init({ + usesDynamicLoginMethods: testContext.usesDynamicLoginMethods, + clientType: testContext.clientType, + appInfo: { + appName: "SuperTokens", + websiteDomain: getWebsiteDomain(), + apiDomain: getApiDomain(), + websiteBasePath, + }, + languageTranslations: { + translations: { + en: { + PWLESS_SIGN_IN_UP_FOOTER_TOS: "TOS", + }, + hu: { + PWLESS_SIGN_IN_UP_FOOTER_TOS: "ÁSZF", + }, }, }, - }, - getRedirectionURL: (context) => { - if (context.action === "SUCCESS") { - let logId = { - emailpassword: "EMAIL_PASSWORD", - thirdparty: "THIRD_PARTY", - passwordless: "PASSWORDLESS", - thirdpartypasswordless: "THIRDPARTYPASSWORDLESS", - thirdpartyemailpassword: "THIRD_PARTY_EMAIL_PASSWORD", - }[context.recipeId]; - - console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`); - setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser); - if (testContext.disableRedirectionAfterSuccessfulSignInUp) { - return null; + getRedirectionURL: (context) => { + if (context.action === "SUCCESS") { + let logId = { + emailpassword: "EMAIL_PASSWORD", + thirdparty: "THIRD_PARTY", + passwordless: "PASSWORDLESS", + thirdpartypasswordless: "THIRDPARTYPASSWORDLESS", + thirdpartyemailpassword: "THIRD_PARTY_EMAIL_PASSWORD", + }[context.recipeId]; + + console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`); + setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser); + if (testContext.disableRedirectionAfterSuccessfulSignInUp) { + return null; + } + console.log(JSON.stringify(context)); + return context.redirectToPath || "/dashboard"; + } else { + console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`); } - console.log(JSON.stringify(context)); - return context.redirectToPath || "/dashboard"; - } else { - console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`); - } - }, - recipeList, -}); + }, + recipeList, + }); +} /* App */ function App() { diff --git a/test/end-to-end/generalerror.test.js b/test/end-to-end/generalerror.test.js index 10160aebd..7d19105be 100644 --- a/test/end-to-end/generalerror.test.js +++ b/test/end-to-end/generalerror.test.js @@ -37,7 +37,7 @@ import { assertProviders, clickOnProviderButton, clickOnProviderButtonWithoutWaiting, - loginWithAuth0, + loginWithMockProvider, isGeneralErrorSupported, setGeneralErrorToLocalStorage, backendBeforeEach, @@ -411,7 +411,7 @@ function getThirdPartyTests(rid, ridForStorage) { await assertProviders(page); let [_, response1] = await Promise.all([ - clickOnProviderButtonWithoutWaiting(page, "Auth0"), + clickOnProviderButtonWithoutWaiting(page, "Mock Provider"), page.waitForResponse( (response) => response.url().includes(GET_AUTH_URL_API) && @@ -436,10 +436,10 @@ function getThirdPartyTests(rid, ridForStorage) { await page.goto(`${TEST_CLIENT_BASE_URL}/auth`); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); let [_, response1] = await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); diff --git a/test/end-to-end/getRedirectionURL.test.js b/test/end-to-end/getRedirectionURL.test.js index c519f9d6e..c765f65de 100644 --- a/test/end-to-end/getRedirectionURL.test.js +++ b/test/end-to-end/getRedirectionURL.test.js @@ -7,7 +7,7 @@ import { screenshotOnFailure, assertProviders, clickOnProviderButton, - loginWithAuth0, + loginWithMockProvider, setPasswordlessFlowType, waitForSTElement, getPasswordlessDevice, @@ -119,9 +119,9 @@ describe("getRedirectionURL Tests", function () { page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck")); @@ -178,9 +178,9 @@ describe("getRedirectionURL Tests", function () { it("Test that isNewRecipeUser works correctly when signing up with auth 0", async function () { await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck")); @@ -368,9 +368,9 @@ describe("getRedirectionURL Tests", function () { page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck")); @@ -668,10 +668,10 @@ describe("getRedirectionURL Tests", function () { ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse( (response) => response.url() === SIGN_IN_UP_API && response.status() === 200 ), @@ -680,7 +680,7 @@ describe("getRedirectionURL Tests", function () { const urlAfterSignUp = await page.url(); const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck")); assert.equal(newUserCheck, "thirdparty-true"); - assert(urlAfterSignUp.includes("/auth/callback/auth0")); + assert(urlAfterSignUp.includes("/auth/callback/mock-provider")); }); }); }); diff --git a/test/end-to-end/multitenancy.dynamic_login_methods.test.js b/test/end-to-end/multitenancy.dynamic_login_methods.test.js index 5e9a8aef1..4e376aa99 100644 --- a/test/end-to-end/multitenancy.dynamic_login_methods.test.js +++ b/test/end-to-end/multitenancy.dynamic_login_methods.test.js @@ -34,12 +34,13 @@ import { loginWithGoogle, clearBrowserCookiesWithoutAffectingConsole, clickOnProviderButton, - loginWithAuth0, + loginWithMockProvider, isMultitenancySupported, isMultitenancyManagementEndpointsSupported, setupTenant, backendBeforeEach, getTextByDataSupertokens, + loginWithAuth0, } from "../helpers"; import { TEST_CLIENT_BASE_URL, diff --git a/test/end-to-end/thirdparty.test.js b/test/end-to-end/thirdparty.test.js index 32994add8..875679ac5 100644 --- a/test/end-to-end/thirdparty.test.js +++ b/test/end-to-end/thirdparty.test.js @@ -26,13 +26,14 @@ import { assertNoSTComponents, generateState, clickOnProviderButton, - loginWithAuth0, + loginWithMockProvider, getGeneralError, waitFor, screenshotOnFailure, clickOnProviderButtonWithoutWaiting, backendBeforeEach, waitForUrl, + loginWithAuth0, } from "../helpers"; import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, GET_AUTH_URL_API } from "../constants"; @@ -138,37 +139,37 @@ export function getThirdPartyTestCases({ authRecipe, rid, logId, signInUpPageLoa ]); }); - it("Successful sign in with Auth0 with redirectToPath (w/ leading slash) keeping query params", async function () { + it("Successful sign in with redirectToPath (w/ leading slash) keeping query params", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=%2Fredirect-here%3Ffoo%3Dbar`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const { pathname, search } = await page.evaluate(() => window.location); assert.deepStrictEqual(pathname + search, "/redirect-here?foo=bar"); }); - it("Successful sign in with Auth0 with redirectToPath (w/o leading slash) keeping query params", async function () { + it("Successful sign in with SSO with redirectToPath (w/o leading slash) keeping query params", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=%3Ffoo%3Dbar`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const { pathname, search } = await page.evaluate(() => window.location); assert.deepStrictEqual(pathname + search, "/?foo=bar"); }); - it("Successful sign in with Auth0 with redirectToPath (query params + fragment)", async function () { + it("Successful sign in with SSO with redirectToPath (query params + fragment)", async function () { await Promise.all([ page.goto( `${TEST_CLIENT_BASE_URL}/auth?redirectToPath=${encodeURIComponent( @@ -178,39 +179,39 @@ export function getThirdPartyTestCases({ authRecipe, rid, logId, signInUpPageLoa page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const { pathname, search, hash } = await page.evaluate(() => window.location); assert.deepStrictEqual(pathname + search + hash, "/redirect-here?foo=bar#cell=4,1-6,2"); }); - it("Successful sign in with Auth0 with redirectToPath (only fragment)", async function () { + it("Successful sign in with SSO with redirectToPath (only fragment)", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=${encodeURIComponent("#cell=4,1-6,2")}`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); const { pathname, search, hash } = await page.evaluate(() => window.location); assert.deepStrictEqual(pathname + search + hash, "/#cell=4,1-6,2"); }); - it("Successful signin with Auth0 and email verification", async function () { + it("Successful signin with SSO and email verification", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?mode=REQUIRED`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await page.waitForSelector(".sessionInfo-user-id"); @@ -242,29 +243,29 @@ export function getThirdPartyTestCases({ authRecipe, rid, logId, signInUpPageLoa ]); }); - it("Successful signin with auth0 and redirectToPath", async function () { + it("Successful signin with SSO and redirectToPath", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=/hello`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await waitForUrl(page, "/hello"); }); - it("Successful signin with auth0 and redirectToPath case sensitive", async function () { + it("Successful signin with SSO and redirectToPath case sensitive", async function () { await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth?redirectToPath=%2FCasE%2FCase-SensItive1-PAth`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await waitForUrl(page, "/CasE/Case-SensItive1-PAth"); @@ -355,8 +356,8 @@ export function getThirdPartyTestCases({ authRecipe, rid, logId, signInUpPageLoa } }; page.on("request", requestHandler); - await clickOnProviderButton(page, "Auth0"); - await loginWithAuth0(page); + await clickOnProviderButton(page, "Mock Provider"); + await loginWithMockProvider(page); const error = await getGeneralError(page); assert.deepStrictEqual(error, "Terms of Service"); }); @@ -391,8 +392,8 @@ export function getThirdPartyTestCases({ authRecipe, rid, logId, signInUpPageLoa }; page.on("request", requestHandler); - await clickOnProviderButton(page, "Auth0"); - await loginWithAuth0(page); + await clickOnProviderButton(page, "Mock Provider"); + await loginWithMockProvider(page); const error = await getGeneralError(page); assert.deepStrictEqual(error, "Test message!!!!"); diff --git a/test/end-to-end/thirdpartyemailpassword.test.js b/test/end-to-end/thirdpartyemailpassword.test.js index 4e1da08de..615eb927d 100644 --- a/test/end-to-end/thirdpartyemailpassword.test.js +++ b/test/end-to-end/thirdpartyemailpassword.test.js @@ -29,7 +29,7 @@ import { getLogoutButton, signUp, toggleSignInSignUp, - loginWithAuth0, + loginWithMockProvider, getLoginWithRedirectToSignIn, getLoginWithRedirectToSignUp, getAuthPageHeaderText, @@ -284,11 +284,11 @@ describe("SuperTokens Third Party Email Password", function () { await waitForSTElement(page, "[data-supertokens~=generalError]", true); }); - it("Successful signin/up with auth0", async function () { + it("Successful signin/up", async function () { await assertProviders(page); - await clickOnProviderButton(page, "Auth0"); + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await page.waitForSelector(".sessionInfo-user-id"); @@ -339,10 +339,10 @@ describe("SuperTokens Third Party Email Password", function () { await Promise.all([await logoutButton.click(), page.waitForNavigation({ waitUntil: "networkidle0" })]); await waitForUrl(page, "/auth"); - // 2. Sign in with auth0 with same address. - await clickOnProviderButton(page, "Auth0"); + // 2. Sign in with SSO with same address. + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await waitForUrl(page, "/dashboard"); diff --git a/test/end-to-end/thirdpartypasswordless.test.js b/test/end-to-end/thirdpartypasswordless.test.js index 7838302e0..f9d1f15ff 100644 --- a/test/end-to-end/thirdpartypasswordless.test.js +++ b/test/end-to-end/thirdpartypasswordless.test.js @@ -24,7 +24,7 @@ import { clickOnProviderButton, getUserIdWithFetch, getLogoutButton, - loginWithAuth0, + loginWithMockProvider, setInputValues, submitForm, waitForSTElement, @@ -145,10 +145,10 @@ describe("SuperTokens Third Party Passwordless", function () { await waitForSTElement(page, `input[name=emailOrPhone]`); - // 3. Sign in with auth0 with same address. - await clickOnProviderButton(page, "Auth0"); + // 3. Sign in with SSO with same address. + await clickOnProviderButton(page, "Mock Provider"); await Promise.all([ - loginWithAuth0(page), + loginWithMockProvider(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); await Promise.all([page.waitForSelector(".sessionInfo-user-id"), page.waitForNetworkIdle()]); diff --git a/test/end-to-end/thirdpartypasswordless.tp.test.js b/test/end-to-end/thirdpartypasswordless.tp.test.js index 71943298f..2fec8f02d 100644 --- a/test/end-to-end/thirdpartypasswordless.tp.test.js +++ b/test/end-to-end/thirdpartypasswordless.tp.test.js @@ -24,7 +24,7 @@ import { clickOnProviderButton, getUserIdWithFetch, getLogoutButton, - loginWithAuth0, + loginWithMockProvider, setInputValues, submitForm, waitForSTElement, diff --git a/test/end-to-end/userContext.test.js b/test/end-to-end/userContext.test.js index 819b92941..acd1328a4 100644 --- a/test/end-to-end/userContext.test.js +++ b/test/end-to-end/userContext.test.js @@ -23,9 +23,10 @@ import { submitFormReturnRequestAndResponse, assertProviders, clickOnProviderButton, - loginWithAuth0, + loginWithMockProvider, backendBeforeEach, waitForUrl, + loginWithAuth0, } from "../helpers"; import { TEST_CLIENT_BASE_URL, diff --git a/test/helpers.js b/test/helpers.js index 22d6976be..d8b29d841 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -622,6 +622,23 @@ export async function loginWithFacebook(page) { await Promise.all([page.keyboard.press("Enter"), page.waitForNavigation({ waitUntil: "networkidle0" })]); } +export async function loginWithMockProvider( + page, + email = "st_test_user@supertokens.io", + userId = "123", + isVerified = true +) { + const url = new URL(page.url()); + await Promise.all([ + page.goto( + `${TEST_CLIENT_BASE_URL}/auth/callback/mock-provider?code=asdf&email=${encodeURIComponent( + email + )}&userId=${encodeURIComponent(userId)}&isVerified=${isVerified}&state=${url.searchParams.get("state")}` + ), + page.waitForNavigation({ waitUntil: "networkidle0" }), + ]); +} + export async function loginWithAuth0(page) { await page.focus("input[type=email]"); await page.keyboard.type(process.env.AUTH0_EMAIL);