Skip to content

Commit

Permalink
added tests for forgetful bahavior in assessment form
Browse files Browse the repository at this point in the history
  • Loading branch information
alivarastepour committed Oct 31, 2023
1 parent 8561425 commit 8af5ed3
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,39 @@ describe("assessment tests", () => {
cy.get(getTestElement("input", `input-radio-${i++}-${7}`)).click();
cy.get(getTestElement("button", "submit-question-button")).click();
});
it("compact test: forgetful behavior", () => {
let i = 1;
cy.get(getTestElement("input", `input-radio-${i++}-${0}`)).click();
cy.get(getTestElement("button", "next-question-button")).click();
cy.wait(1000);
i++;
cy.get(getTestElement("button", "next-question-button")).click();
cy.wait(1000);
cy.get(getTestElement("input", `input-number-${i++}`)).type("12");
cy.get(getTestElement("button", "next-question-button")).click();
cy.wait(1000);
cy.get(getTestElement("input", `input-radio-${i++}-${3}`)).click();
cy.get(getTestElement("button", "next-question-button")).click();
cy.wait(1000);
cy.get(getTestElement("input", `input-radio-${i++}-${1}`)).click();
cy.get(getTestElement("button", "next-question-button")).click();
cy.wait(1000);
cy.get(getTestElement("input", `input-radio-${i++}-${7}`)).click();
cy.get(getTestElement("button", "submit-question-button")).click();
cy.get(getTestElement("div", "form-error-wrapper"))
.its("html")
.should("not.be", "");
cy.get(getTestElement("button", "prev-question-button")).click();
cy.get(getTestElement("div", "form-error-wrapper")).should("not.exist");
cy.get(getTestElement("button", "prev-question-button")).click();
cy.get(getTestElement("button", "prev-question-button")).click();
cy.get(getTestElement("button", "prev-question-button")).click();
cy.get(getTestElement("input", `input-radio-${2}-${1}`)).click();
cy.get(getTestElement("button", "next-question-button")).click();
cy.get(getTestElement("button", "next-question-button")).click();
cy.get(getTestElement("button", "next-question-button")).click();
cy.get(getTestElement("button", "next-question-button")).click();
cy.get(getTestElement("button", "submit-question-button")).click();
cy.get(getTestElement("div", "form-error-wrapper")).should("not.exist");
});
});

0 comments on commit 8af5ed3

Please sign in to comment.