diff --git a/client/cypress/e2e/intake/intake-checklist.cy.js b/client/cypress/e2e/intake/intake-checklist.cy.js index 2f598f98e..361196f7a 100644 --- a/client/cypress/e2e/intake/intake-checklist.cy.js +++ b/client/cypress/e2e/intake/intake-checklist.cy.js @@ -3,7 +3,7 @@ import job from "../../fixtures/jobs/job-3.json"; describe( "Adding job to checklist", { - defaultCommandTimeout: 5000, + defaultCommandTimeout: 10000, }, () => { beforeEach(() => { @@ -43,8 +43,36 @@ describe( // intakechecklist const checklists = bodyshop.intakechecklist.form; - //console.log(checklists); - cy.get(".ant-slider-dot:eq(1)").click({ force: true }); + checklists.forEach((item, index) => { + if (item.type === "text") { + cy.get('[data-cy="config-form-components"] > div') + .eq(index) + .find("input:text") + .type("Random Word"); + } else if (item.type === "textarea") { + cy.get('[data-cy="config-form-components"] > div') + .eq(index) + .find("textarea") + .type("Random Word"); + } else if (item.type === "checkbox") { + cy.get('[data-cy="config-form-components"] > div') + .eq(index) + .find("input:checkbox") + .check(); + } else if (item.type === "slider") { + cy.get('[data-cy="config-form-components"] > div') + .eq(index) + .find(".ant-slider-dot:eq(1)") + .click({ force: true }); + } else if (item.type === "rate") { + cy.get('[data-cy="config-form-components"] > div') + .eq(index) + .find(".ant-rate > li") + .eq(Math.floor(Math.random() * 4)) + .find("div[role='radio']") + .click({ force: true }); + } + }); }); }); diff --git a/client/src/components/config-form-components/config-form-components.component.jsx b/client/src/components/config-form-components/config-form-components.component.jsx index abcd6a6b5..1c77a5c65 100644 --- a/client/src/components/config-form-components/config-form-components.component.jsx +++ b/client/src/components/config-form-components/config-form-components.component.jsx @@ -3,7 +3,7 @@ import FormTypes from "./config-form-types"; export default function ConfirmFormComponents({ componentList, readOnly }) { return ( -