From e99cddb6aac2b678d112a4724083af015e787f34 Mon Sep 17 00:00:00 2001 From: amitbadala Date: Mon, 20 Nov 2023 17:09:44 +0530 Subject: [PATCH] Handle react 16 tests for new features --- test/end-to-end/signin.test.js | 15 ++++++++++ test/end-to-end/signup.test.js | 21 ++++++++++++++ .../thirdpartyemailpassword.test.js | 29 +++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/test/end-to-end/signin.test.js b/test/end-to-end/signin.test.js index 49f20b9a9..bcbb7cff1 100644 --- a/test/end-to-end/signin.test.js +++ b/test/end-to-end/signin.test.js @@ -54,6 +54,7 @@ import { waitForText, backendBeforeEach, getInputField, + isReact16, } from "../helpers"; import fetch from "isomorphic-fetch"; import { SOMETHING_WENT_WRONG_ERROR } from "../constants"; @@ -672,6 +673,13 @@ describe("SuperTokens SignIn", function () { }); describe("Default fields", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + it("Should contain email and password fields prefilled", async function () { await page.evaluate(() => window.localStorage.setItem("SIGNIN_SETTING_TYPE", "DEFAULT_FIELDS")); @@ -751,6 +759,13 @@ describe("SuperTokens SignIn", function () { }); describe("nonOptionalErrorMsg", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + it("Should be displayed on a blank form submit", async function () { // set cookie and reload which loads the form with custom field await page.evaluate(() => diff --git a/test/end-to-end/signup.test.js b/test/end-to-end/signup.test.js index 81b5b4bd8..c747339ca 100644 --- a/test/end-to-end/signup.test.js +++ b/test/end-to-end/signup.test.js @@ -41,6 +41,7 @@ import { backendBeforeEach, setSelectDropdownValue, getInputField, + isReact16, } from "../helpers"; import { @@ -346,6 +347,12 @@ describe("SuperTokens SignUp", function () { }); describe("Custom fields tests", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); beforeEach(async function () { // set cookie and reload which loads the form with custom field await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "CUSTOM_FIELDS")); @@ -568,6 +575,13 @@ describe("SuperTokens SignUp", function () { // Default values test describe("Default fields tests", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + beforeEach(async function () { // set cookie and reload which loads the form fields with default values await page.evaluate(() => @@ -684,6 +698,13 @@ describe("SuperTokens SignUp", function () { }); describe("Incorrect field config test", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + beforeEach(async function () { // set cookie and reload which loads the form fields with default values await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_FIELDS")); diff --git a/test/end-to-end/thirdpartyemailpassword.test.js b/test/end-to-end/thirdpartyemailpassword.test.js index fddbc41eb..d7a29ddea 100644 --- a/test/end-to-end/thirdpartyemailpassword.test.js +++ b/test/end-to-end/thirdpartyemailpassword.test.js @@ -47,6 +47,7 @@ import { setSelectDropdownValue, getInputField, getLabelsText, + isReact16, } from "../helpers"; import { TEST_CLIENT_BASE_URL, @@ -445,6 +446,13 @@ describe("SuperTokens Third Party Email Password", function () { }); describe("SignIn default field tests", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + it("Should contain email and password fields prefilled", async function () { await page.evaluate(() => window.localStorage.setItem("SIGNIN_SETTING_TYPE", "DEFAULT_FIELDS")); @@ -510,6 +518,13 @@ describe("SuperTokens Third Party Email Password", function () { }); describe("Third Party signup config supports custom fields tests", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + beforeEach(async function () { await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "CUSTOM_FIELDS")); @@ -743,6 +758,13 @@ describe("SuperTokens Third Party Email Password", function () { // Default values test describe("Third Party signup default value for fields test", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + beforeEach(async function () { // set cookie and reload which loads the form fields with default values await page.evaluate(() => @@ -867,6 +889,13 @@ describe("SuperTokens Third Party Email Password", function () { }); describe("Third Party signup config Incorrect field message test", function () { + before(function () { + const isReact16App = isReact16(); + if (isReact16App) { + this.skip(); + } + }); + beforeEach(async function () { // set cookie and reload which loads the form fields with default values await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_FIELDS"));