Remove cy.wait in cypress test
This commit is contained in:
parent
08b99fb843
commit
d303506ae7
|
|
@ -19,18 +19,14 @@ describe("feedbackStudent.cy.js", () => {
|
||||||
expect(url).to.match(/\/fahrzeug\/feedback(\?step=0)?$/);
|
expect(url).to.match(/\/fahrzeug\/feedback(\?step=0)?$/);
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// fill feedback form
|
// fill feedback form
|
||||||
// step 1
|
// step 1
|
||||||
cy.url().should("include", "step=1");
|
cy.url().should("include", "step=1");
|
||||||
cy.get('[data-cy="next-step"]').should("be.disabled");
|
cy.get('[data-cy="next-step"]').should("be.disabled");
|
||||||
cy.get('[data-cy="radio-4"]').click();
|
cy.get('[data-cy="radio-4"]').click();
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 2
|
// step 2
|
||||||
cy.url().should("include", "step=2");
|
cy.url().should("include", "step=2");
|
||||||
|
|
@ -44,41 +40,31 @@ describe("feedbackStudent.cy.js", () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
cy.get('[data-cy="radio-3"]').click();
|
cy.get('[data-cy="radio-3"]').click();
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 3
|
// step 3
|
||||||
cy.url().should("include", "step=3");
|
cy.url().should("include", "step=3");
|
||||||
cy.get('[data-cy="next-step"]').should("be.disabled");
|
cy.get('[data-cy="next-step"]').should("be.disabled");
|
||||||
cy.get('[data-cy="radio-80"]').click();
|
cy.get('[data-cy="radio-80"]').click();
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 4
|
// step 4
|
||||||
cy.url().should("include", "step=4");
|
cy.url().should("include", "step=4");
|
||||||
cy.get('[data-cy="next-step"]').should("be.disabled");
|
cy.get('[data-cy="next-step"]').should("be.disabled");
|
||||||
cy.get('[data-cy="radio-false"]').click();
|
cy.get('[data-cy="radio-false"]').click();
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 5
|
// step 5
|
||||||
cy.url().should("include", "step=5");
|
cy.url().should("include", "step=5");
|
||||||
cy.get('[data-cy="next-step"]').should("be.disabled");
|
cy.get('[data-cy="next-step"]').should("be.disabled");
|
||||||
cy.get('[data-cy="radio-2"]').click();
|
cy.get('[data-cy="radio-2"]').click();
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 6
|
// step 6
|
||||||
cy.url().should("include", "step=6");
|
cy.url().should("include", "step=6");
|
||||||
cy.get('[data-cy="next-step"]').should("be.disabled");
|
cy.get('[data-cy="next-step"]').should("be.disabled");
|
||||||
cy.get('[data-cy="radio-1"]').click();
|
cy.get('[data-cy="radio-1"]').click();
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 7
|
// step 7
|
||||||
cy.url().should("include", "step=7");
|
cy.url().should("include", "step=7");
|
||||||
|
|
@ -86,17 +72,13 @@ describe("feedbackStudent.cy.js", () => {
|
||||||
cy.get('[data-cy="it-textarea-instructor_open_feedback"]').type(
|
cy.get('[data-cy="it-textarea-instructor_open_feedback"]').type(
|
||||||
"Der Kursleiter ist eigentlich ganz nett."
|
"Der Kursleiter ist eigentlich ganz nett."
|
||||||
);
|
);
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 8
|
// step 8
|
||||||
cy.url().should("include", "step=8");
|
cy.url().should("include", "step=8");
|
||||||
cy.get('[data-cy="next-step"]').should("be.disabled");
|
cy.get('[data-cy="next-step"]').should("be.disabled");
|
||||||
cy.get('[data-cy="radio-true"]').click();
|
cy.get('[data-cy="radio-true"]').click();
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 9
|
// step 9
|
||||||
cy.url().should("include", "step=9");
|
cy.url().should("include", "step=9");
|
||||||
|
|
@ -104,9 +86,7 @@ describe("feedbackStudent.cy.js", () => {
|
||||||
cy.get('[data-cy="it-textarea-course_negative_feedback"]').type(
|
cy.get('[data-cy="it-textarea-course_negative_feedback"]').type(
|
||||||
"Ich bin unzufrieden mit einigen Sachen."
|
"Ich bin unzufrieden mit einigen Sachen."
|
||||||
);
|
);
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
// step 10
|
// step 10
|
||||||
cy.url().should("include", "step=10");
|
cy.url().should("include", "step=10");
|
||||||
|
|
@ -114,21 +94,22 @@ describe("feedbackStudent.cy.js", () => {
|
||||||
cy.get('[data-cy="it-textarea-course_positive_feedback"]').type(
|
cy.get('[data-cy="it-textarea-course_positive_feedback"]').type(
|
||||||
"Ich bin zufrieden mit den meisten Dingen."
|
"Ich bin zufrieden mit den meisten Dingen."
|
||||||
);
|
);
|
||||||
cy.wait(200);
|
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.wait(200);
|
|
||||||
|
|
||||||
cy.url().should("include", "step=11");
|
cy.url().should("include", "step=11");
|
||||||
cy.get('[data-cy="sendFeedbackButton"]').click();
|
cy.get('[data-cy="sendFeedbackButton"]').click();
|
||||||
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
|
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
|
||||||
|
|
||||||
// marked complete in circle
|
// marked complete in circle
|
||||||
|
cy.url().should((url) => {
|
||||||
|
expect(url).to.match(/\/fahrzeug#lu-transfer?$/);
|
||||||
|
});
|
||||||
|
cy.reload();
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="test-lehrgang-lp-circle-fahrzeug-lc-feedback-checkbox"]'
|
'[data-cy="test-lehrgang-lp-circle-fahrzeug-lc-feedback-checkbox"]'
|
||||||
).should("have.class", "cy-checked");
|
).should("have.class", "cy-checked");
|
||||||
|
|
||||||
// reopening page should get directly to last step
|
// reopening page should get directly to last step
|
||||||
cy.reload();
|
|
||||||
cy.visit("/course/test-lehrgang/learn/fahrzeug/feedback");
|
cy.visit("/course/test-lehrgang/learn/fahrzeug/feedback");
|
||||||
|
|
||||||
// check stored data
|
// check stored data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue