93 lines
3.0 KiB
JavaScript
93 lines
3.0 KiB
JavaScript
import { login } from "../helpers";
|
|
|
|
describe("feedbackTrainer.cy.js", () => {
|
|
beforeEach(() => {
|
|
cy.visit("/course/test-lehrgang/learn/fahrzeug/feedback");
|
|
});
|
|
|
|
it("can open feedback results page with empty results", () => {
|
|
cy.manageCommand("cypress_reset");
|
|
login("test-trainer1@example.com", "test");
|
|
cy.visit("/course/test-lehrgang/cockpit");
|
|
cy.get(
|
|
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]'
|
|
).click();
|
|
|
|
cy.get('[data-cy="feedback-data-amount"]').should("contain", "0");
|
|
});
|
|
|
|
it("can open feedback results page with results", () => {
|
|
cy.manageCommand("cypress_reset --create-feedback-responses");
|
|
login("test-trainer1@example.com", "test");
|
|
cy.visit("/course/test-lehrgang/cockpit");
|
|
cy.get(
|
|
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]'
|
|
).click();
|
|
|
|
cy.get('[data-cy="feedback-data-amount"]').should("contain", "3");
|
|
|
|
cy.get('[data-cy="question-1"]')
|
|
.find('[data-cy="rating-scale-average"]')
|
|
.should("contain", "3.3");
|
|
|
|
cy.get('[data-cy="question-2"]')
|
|
.find('[data-cy="rating-scale-average"]')
|
|
.should("contain", "3.0");
|
|
|
|
cy.get('[data-cy="question-3"]')
|
|
.find('[data-cy="percentage-value-40%"]')
|
|
.should("contain", "33.3");
|
|
cy.get('[data-cy="question-3"]')
|
|
.find('[data-cy="percentage-value-80%"]')
|
|
.should("contain", "33.3");
|
|
cy.get('[data-cy="question-3"]')
|
|
.find('[data-cy="percentage-value-100%"]')
|
|
.should("contain", "33.3");
|
|
|
|
cy.get('[data-cy="question-4"]')
|
|
.find('[data-cy="popover-yes"]')
|
|
.click()
|
|
.find('[data-cy="num-yes"]')
|
|
.should("contain", "3");
|
|
cy.get('[data-cy="question-4"]')
|
|
.find('[data-cy="popover-no"]')
|
|
.click()
|
|
.find('[data-cy="num-no"]')
|
|
.should("contain", "0");
|
|
|
|
cy.get('[data-cy="question-5"]')
|
|
.find('[data-cy="rating-scale-average"]')
|
|
.should("contain", "2.7");
|
|
|
|
cy.get('[data-cy="question-6"]')
|
|
.find('[data-cy="rating-scale-average"]')
|
|
.should("contain", "3.0");
|
|
|
|
cy.get('[data-cy="question-7"]')
|
|
.should("contain", "Super Kurs!")
|
|
.should("contain", "Super, bin begeistert")
|
|
.should("contain", "Ok, entspricht den Erwartungen");
|
|
|
|
cy.get('[data-cy="question-8"]')
|
|
.find('[data-cy="popover-yes"]')
|
|
.click()
|
|
.find('[data-cy="num-yes"]')
|
|
.should("contain", "2");
|
|
cy.get('[data-cy="question-8"]')
|
|
.find('[data-cy="popover-no"]')
|
|
.click()
|
|
.find('[data-cy="num-no"]')
|
|
.should("contain", "1");
|
|
|
|
cy.get('[data-cy="question-9"]')
|
|
.should("contain", "Nichts Schlechtes")
|
|
.should("contain", "Es wäre praktisch, Zugang zu einer FAQ zu haben.")
|
|
.should("contain", "Mehr Videos wären schön.");
|
|
|
|
cy.get('[data-cy="question-10"]')
|
|
.should("contain", "Nur Gutes.")
|
|
.should("contain", "Das Beispiel mit der Katze fand ich sehr gut")
|
|
.should("contain", "Die Präsentation war super");
|
|
});
|
|
});
|