From 09251d84e3ea4be0ca5a10cfe7c404affc0ca249 Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Thu, 21 Sep 2023 18:19:49 +0200 Subject: [PATCH] ci: debugging tests on CI --- test/end-to-end/accountlinking.test.js | 4 ++-- ...multitenancy.dynamic_login_methods.test.js | 2 +- .../multitenancy.tenant_interactions.test.js | 2 +- .../end-to-end/thirdpartypasswordless.test.js | 24 +++++++++++++++++-- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/test/end-to-end/accountlinking.test.js b/test/end-to-end/accountlinking.test.js index 9e53cf47f..0393ffdcb 100644 --- a/test/end-to-end/accountlinking.test.js +++ b/test/end-to-end/accountlinking.test.js @@ -50,7 +50,7 @@ import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, RESET_PASSW /* * Tests. */ -describe("SuperTokens Account linking", function () { +describe.only("SuperTokens Account linking", function () { let browser; let page; let consoleLogs; @@ -532,7 +532,7 @@ describe("SuperTokens Account linking", function () { assert.strictEqual(new URL(page.url()).pathname, "/auth/reset-password"); }); - it("should allow sign in w/ a verified emailpassword user in case of conflict", async function () { + it.only("should allow sign in w/ a verified emailpassword user in case of conflict", async function () { const email = `test-user+${Date.now()}@supertokens.com`; await page.evaluate(() => window.localStorage.setItem("mode", "REQUIRED")); 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 4001ee357..9215f6ab3 100644 --- a/test/end-to-end/multitenancy.dynamic_login_methods.test.js +++ b/test/end-to-end/multitenancy.dynamic_login_methods.test.js @@ -52,7 +52,7 @@ let connectionURI; /* * Tests. */ -describe("SuperTokens Multitenancy dynamic login methods", function () { +describe.only("SuperTokens Multitenancy dynamic login methods", function () { let browser; let page; let pageCrashed; diff --git a/test/end-to-end/multitenancy.tenant_interactions.test.js b/test/end-to-end/multitenancy.tenant_interactions.test.js index 23b7351e7..4e63bf5ba 100644 --- a/test/end-to-end/multitenancy.tenant_interactions.test.js +++ b/test/end-to-end/multitenancy.tenant_interactions.test.js @@ -58,7 +58,7 @@ import { /* * Tests. */ -describe("SuperTokens Multitenancy tenant interactions", function () { +describe.only("SuperTokens Multitenancy tenant interactions", function () { let browser; let page; let pageCrashed; diff --git a/test/end-to-end/thirdpartypasswordless.test.js b/test/end-to-end/thirdpartypasswordless.test.js index 9474ba8ba..eabd3d88b 100644 --- a/test/end-to-end/thirdpartypasswordless.test.js +++ b/test/end-to-end/thirdpartypasswordless.test.js @@ -65,7 +65,7 @@ describe("SuperTokens Third Party Passwordless", function () { } }); - describe("Recipe combination tests", () => { + describe.only("Recipe combination tests", () => { before(async function () { await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, { method: "POST", @@ -77,7 +77,7 @@ describe("SuperTokens Third Party Passwordless", function () { browser = await puppeteer.launch({ args: ["--no-sandbox", "--disable-setuid-sandbox"], - headless: true, + headless: false, }); page = await browser.newPage(); page.on("console", (consoleObj) => { @@ -117,42 +117,62 @@ describe("SuperTokens Third Party Passwordless", function () { it("No account consolidation", async function () { // 1. Sign up with credentials + console.log("a"); await setPasswordlessFlowType("EMAIL_OR_PHONE", "USER_INPUT_CODE"); + console.log("b"); await page.evaluate(() => localStorage.removeItem("supertokens-passwordless-loginAttemptInfo")); + console.log("c"); await Promise.all([ page.goto(`${TEST_CLIENT_BASE_URL}/auth`), page.waitForNavigation({ waitUntil: "networkidle0" }), ]); + console.log("d"); await setInputValues(page, [{ name: "emailOrPhone", value: email }]); + console.log("e"); await submitForm(page); + console.log("f"); await waitForSTElement(page, "[data-supertokens~=input][name=userInputCode]"); + console.log("g"); const loginAttemptInfo = JSON.parse( await page.evaluate(() => localStorage.getItem("supertokens-passwordless-loginAttemptInfo")) ); + console.log("h"); const device = await getPasswordlessDevice(loginAttemptInfo); + console.log("i"); await setInputValues(page, [{ name: "userInputCode", value: device.codes[0].userInputCode }]); + console.log("j"); await submitForm(page); + console.log("k"); await Promise.all([page.waitForSelector(".sessionInfo-user-id"), page.waitForNetworkIdle()]); + console.log("l"); const passwordlessUserId = await getUserIdWithFetch(page); // 2. Log out + console.log("m"); const logoutButton = await getLogoutButton(page); + console.log("n"); await Promise.all([await logoutButton.click(), page.waitForNavigation({ waitUntil: "networkidle0" })]); + console.log("o"); await waitForSTElement(page, `input[name=emailOrPhone]`); // 3. Sign in with auth0 with same address. + console.log("p"); await clickOnProviderButton(page, "Auth0"); + console.log("q"); await Promise.all([ loginWithAuth0(page), page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200), ]); + console.log("r"); await Promise.all([page.waitForSelector(".sessionInfo-user-id"), page.waitForNetworkIdle()]); + console.log("s"); const thirdPartyUserId = await getUserIdWithFetch(page); + console.log(thirdPartyUserId, passwordlessUserId); // 4. Compare userIds assert.notDeepStrictEqual(thirdPartyUserId, passwordlessUserId);