diff --git a/test/end-to-end/getRedirectionURL.test.js b/test/end-to-end/getRedirectionURL.test.js index fab1fdbe7..3d12f2b40 100644 --- a/test/end-to-end/getRedirectionURL.test.js +++ b/test/end-to-end/getRedirectionURL.test.js @@ -23,7 +23,6 @@ import { TEST_CLIENT_BASE_URL, SIGN_IN_UP_API } from "../constants"; describe("getRedirectionURL Tests", function () { let browser; - let page; before(async function () { await backendHook("before"); @@ -46,6 +45,8 @@ describe("getRedirectionURL Tests", function () { describe("Test that isNewRecipeUser is passed correctly", function () { describe("Email Password Recipe", function () { + let page; + beforeEach(async function () { page = await browser.newPage(); const coreUrl = await setupCoreApp(); @@ -72,6 +73,8 @@ describe("getRedirectionURL Tests", function () { }); describe("Third party recipe", function () { + let page; + before(async function () { const coreUrl = await setupCoreApp(); await setupST({ coreUrl }); @@ -105,6 +108,8 @@ describe("getRedirectionURL Tests", function () { }); describe("Thirdpartyemailpassword recipe", function () { + let page; + before(async function () { const coreUrl = await setupCoreApp(); await setupST({ coreUrl }); @@ -145,6 +150,7 @@ describe("getRedirectionURL Tests", function () { describe("Passwordless recipe", function () { const exampleEmail = "test@example.com"; + let page; before(async function () { let _isPasswordlessSupported = await isPasswordlessSupported(); @@ -207,6 +213,7 @@ describe("getRedirectionURL Tests", function () { describe("ThirdPartyPasswordless recipe", function () { const exampleEmail = "test@example.com"; + let page; before(async function () { let _isThirdPartyPasswordlessSupported = await isThirdPartyPasswordlessSupported(); @@ -283,6 +290,8 @@ describe("getRedirectionURL Tests", function () { describe("No Redirection", function () { describe("Email Password Recipe", function () { + let page; + before(async function () { const coreUrl = await setupCoreApp(); await setupST({ coreUrl }); @@ -320,6 +329,7 @@ describe("getRedirectionURL Tests", function () { describe("Passwordless recipe", function () { const exampleEmail = "test@example.com"; + let page; before(async function () { let _isPasswordlessSupported = await isPasswordlessSupported(); @@ -387,6 +397,7 @@ describe("getRedirectionURL Tests", function () { describe("ThirdPartyPasswordless recipe: Magic Link", function () { const exampleEmail = "test@example.com"; + let page; before(async function () { let _isThirdPartyPasswordlessSupported = await isThirdPartyPasswordlessSupported(); @@ -453,6 +464,7 @@ describe("getRedirectionURL Tests", function () { }); describe("ThirdParty Recipe", function () { + let page; before(async function () { const coreUrl = await setupCoreApp(); await setupST({ coreUrl }); diff --git a/test/end-to-end/mfa.signin.test.js b/test/end-to-end/mfa.signin.test.js index b96635aa1..020918c6e 100644 --- a/test/end-to-end/mfa.signin.test.js +++ b/test/end-to-end/mfa.signin.test.js @@ -113,7 +113,7 @@ describe("SuperTokens SignIn w/ MFA", function () { it("sign in with email-otp (auto-setup)", async function () { const email = await getTestEmail(); - setupST({ + await setupST({ ...appConfig, mfaInfo: { requirements: ["otp-email"], @@ -139,7 +139,7 @@ describe("SuperTokens SignIn w/ MFA", function () { const email = await getTestEmail(); const phoneNumber = getTestPhoneNumber(); - setupST({ + await setupST({ ...appConfig, mfaInfo: { requirements: [{ oneOf: ["otp-email", "otp-phone"] }], @@ -163,7 +163,7 @@ describe("SuperTokens SignIn w/ MFA", function () { }); it("set up otp-email and sign-in", async function () { - setupST({ + await setupST({ ...appConfig, mfaInfo: { requirements: [], @@ -179,7 +179,7 @@ describe("SuperTokens SignIn w/ MFA", function () { await logout(page); - setupST({ + await setupST({ ...appConfig, mfaInfo: { requirements: [{ oneOf: ["otp-email"] }], @@ -203,7 +203,7 @@ describe("SuperTokens SignIn w/ MFA", function () { }); it("set up totp and sign-in", async function () { - setupST({ + await setupST({ ...appConfig, mfaInfo: { requirements: [], @@ -211,7 +211,7 @@ describe("SuperTokens SignIn w/ MFA", function () { }); const email = await getTestEmail(); - setupST({ + await setupST({ ...appConfig, mfaInfo: { requirements: [{ oneOf: ["otp-email", "totp"] }], @@ -245,7 +245,7 @@ describe("SuperTokens SignIn w/ MFA", function () { it("should show access denied if the only next option is an unknown factor id", async () => { const email = await getTestEmail(); - setupST({ + await setupST({ ...appConfig, mfaInfo: { requirements: ["unknown"], @@ -258,7 +258,7 @@ describe("SuperTokens SignIn w/ MFA", function () { }); it("should throw error if there are no valid next options", async () => { - setupST({ + await setupST({ ...appConfig, mfaInfo: { requirements: ["unknown"],