From 478aec2244b9db00f0613acd79de90204bb8a9fe Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 24 Apr 2025 18:32:45 +0530 Subject: [PATCH 1/3] update: remove `enabledRecipes` config --- test/end-to-end/generalerror.test.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/test/end-to-end/generalerror.test.js b/test/end-to-end/generalerror.test.js index ca8f16d67..9f498f6ba 100644 --- a/test/end-to-end/generalerror.test.js +++ b/test/end-to-end/generalerror.test.js @@ -65,7 +65,6 @@ let consoleLogs; describe("General error rendering", function () { let coreUrl; - let enabledRecipes = undefined; before(async function () { const _isGeneralErrorSupported = await isGeneralErrorSupported(); if (!_isGeneralErrorSupported) { @@ -79,7 +78,7 @@ describe("General error rendering", function () { beforeEach(async function () { await backendHook("beforeEach"); coreUrl = await setupCoreApp(); - await setupST({ coreUrl, enabledRecipes }); + await setupST({ coreUrl }); page = await browser.newPage(); consoleLogs = []; @@ -214,18 +213,11 @@ describe("General error rendering", function () { }); describe("ThirdPartyEmailPassword", function () { - before(async function () { - enabledRecipes = ["thirdpartyemailpassword", "session"]; - }); - getEmailPasswordTests("thirdpartyemailpassword", "THIRD_PARTY_EMAIL_PASSWORD"); getThirdPartyTests("thirdpartyemailpassword", "THIRD_PARTY_EMAIL_PASSWORD"); }); describe("ThirdPartyPasswordless", function () { - before(async function () { - enabledRecipes = ["thirdpartypasswordless", "session"]; - }); getThirdPartyTests("thirdpartypasswordless", "THIRD_PARTY_PASSWORDLESS"); }); From a5fd10e6dbfd8121f2dcff03bba89979337087fd Mon Sep 17 00:00:00 2001 From: Deepjyoti Barman Date: Fri, 25 Apr 2025 12:24:51 +0530 Subject: [PATCH 2/3] Skip thirdpartyemailpassword if not enabled in backend --- test/end-to-end/thirdpartyemailpassword.test.js | 5 +++++ test/helpers.js | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/test/end-to-end/thirdpartyemailpassword.test.js b/test/end-to-end/thirdpartyemailpassword.test.js index 76f357c94..75f515039 100644 --- a/test/end-to-end/thirdpartyemailpassword.test.js +++ b/test/end-to-end/thirdpartyemailpassword.test.js @@ -51,6 +51,7 @@ import { backendHook, setupCoreApp, setupST, + isThirdPartyEmailPasswordSupported, } from "../helpers"; import { TEST_CLIENT_BASE_URL, @@ -76,6 +77,10 @@ describe("SuperTokens Third Party Email Password", function () { const appConfig = {}; before(async function () { + if (!(await isThirdPartyEmailPasswordSupported())) { + this.skip(); + } + await backendHook("before"); const coreUrl = await setupCoreApp(); appConfig.coreUrl = coreUrl; diff --git a/test/helpers.js b/test/helpers.js index 72c86dd63..0980f6602 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -956,6 +956,15 @@ export async function isThirdPartyPasswordlessSupported() { return false; } +export async function isThirdPartyEmailPasswordSupported() { + const features = await getFeatureFlags(); + if (features.includes("thirdpartyemailpassword")) { + return true; + } + + return false; +} + export async function isUserRolesSupported() { const features = await getFeatureFlags(); if (!features.includes("userroles")) { From a6989d0525ac35ee9370bda2f18761cf63394e4a Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Sat, 26 Apr 2025 10:17:42 +0530 Subject: [PATCH 3/3] fix: `after` hook page close failures --- test/end-to-end/getRedirectionURL.test.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/end-to-end/getRedirectionURL.test.js b/test/end-to-end/getRedirectionURL.test.js index 8f710df23..1bbdda14e 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 }); @@ -304,6 +313,7 @@ describe("getRedirectionURL Tests", function () { describe("Passwordless recipe", function () { const exampleEmail = "test@example.com"; + let page; before(async function () { let _isPasswordlessSupported = await isPasswordlessSupported(); @@ -345,6 +355,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(); @@ -386,6 +397,7 @@ describe("getRedirectionURL Tests", function () { }); describe("ThirdParty Recipe", function () { + let page; before(async function () { const coreUrl = await setupCoreApp(); await setupST({ coreUrl });