Skip to content

Commit

Permalink
A seperate func to fetch custom comp not required
Browse files Browse the repository at this point in the history
  • Loading branch information
amitbadala committed Oct 24, 2023
1 parent 9136be9 commit e365a13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 4 additions & 5 deletions test/end-to-end/signup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
getGeneralError,
waitForSTElement,
backendBeforeEach,
getCustomComponents,
setSelectDropdownValue,
} from "../helpers";

Expand Down Expand Up @@ -363,11 +362,11 @@ describe("SuperTokens SignUp", function () {
assert.deepStrictEqual(text, "Sign Up");

// check if select dropdown is loaded
const selectDropdownExists = await getCustomComponents(page, "select");
const selectDropdownExists = await waitForSTElement(page, "select");
assert.ok(selectDropdownExists, "Select dropdown exists");

// check if checbox is loaded
const checkboxExists = await getCustomComponents(page, 'input[type="checkbox"]');
const checkboxExists = await waitForSTElement(page, 'input[type="checkbox"]');
assert.ok(checkboxExists, "Checkbox exists");
});

Expand Down Expand Up @@ -397,7 +396,7 @@ describe("SuperTokens SignUp", function () {
assert.deepStrictEqual(formFieldErrors, ["Field is not optional"]);

// check terms and condition checkbox
let termsCheckbox = await getCustomComponents(page, '[name="terms"]');
let termsCheckbox = await waitForSTElement(page, '[name="terms"]');
await page.evaluate((e) => e.click(), termsCheckbox);
await submitForm(page);
formFieldErrors = await getFieldErrors(page);
Expand Down Expand Up @@ -434,7 +433,7 @@ describe("SuperTokens SignUp", function () {
await setSelectDropdownValue(page, 'select[name="ratings"]', customFields["ratings"]);

// Check terms and condition checkbox
let termsCheckbox = await getCustomComponents(page, '[name="terms"]');
let termsCheckbox = await waitForSTElement(page, '[name="terms"]');
await page.evaluate((e) => e.click(), termsCheckbox);

await submitForm(page);
Expand Down
4 changes: 0 additions & 4 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@ export async function getInputNames(page) {
);
}

export async function getCustomComponents(page, element) {
return waitForSTElement(page, element);
}

export async function getInputAdornmentsSuccess(page) {
await waitForSTElement(page);
return await page.evaluate(
Expand Down

0 comments on commit e365a13

Please sign in to comment.