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"); }); describe("FeedbackUK", function () { 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"); // check titles of questions cy.get('[data-cy="question-1"]').should( "contain", "Zufriedenheit insgesamt" ); cy.get('[data-cy="question-2"]').should( "contain", "Zielerreichung insgesamt" ); cy.get('[data-cy="question-3"]').should( "contain", "Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Kurs?" ); cy.get('[data-cy="question-4"]').should( "contain", "Waren die Vorbereitungsaufträge klar und verständlich?" ); cy.get('[data-cy="question-5"]').should( "contain", "Wie beurteilst du die Themensicherheit und Fachkompetenz des Kursleiters/der Kursleiterin?" ); cy.get('[data-cy="question-6"]').should( "contain", "Wurden Fragen und Anregungen der Kursteilnehmenden ernst genommen und aufgegriffen?" ); cy.get('[data-cy="question-7"]').should( "contain", "Was möchtest du dem Kursleiter/der Kursleiterin sonst noch sagen?" ); cy.get('[data-cy="question-8"]').should( "contain", "Würdest du den Kurs weiterempfehlen?" ); cy.get('[data-cy="question-9"]').should( "contain", "Wo siehst du Verbesserungspotential?" ); cy.get('[data-cy="question-10"]').should( "contain", "Was hat dir besonders gut gefallen?" ); 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"); }); }); describe("FeedbackVV", function () { 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="dropdown-select"]').click(); cy.get('[data-cy="dropdown-select-option-Reisen"]').click(); cy.get( '[data-cy="show-feedback-btn-test-lehrgang-lp-circle-reisen-lc-feedback"]' ).click(); cy.get('[data-cy="feedback-data-amount"]').should("contain", "3"); // check titles of questions cy.get('[data-cy="question-1"]').should( "contain", "Zufriedenheit insgesamt" ); cy.get('[data-cy="question-2"]').should( "contain", "Zielerreichung insgesamt" ); cy.get('[data-cy="question-3"]').should( "contain", "Wie beurteilst du deine Sicherheit bezüglichen den Themen nach dem Circle?" ); cy.get('[data-cy="question-4"]').should( "contain", "Waren die Praxisaufträge klar und verständlich?" ); cy.get('[data-cy="question-5"]').should( "contain", "Würdest du den Circle weiterempfehlen?" ); cy.get('[data-cy="question-6"]').should( "contain", "Wo siehst du Verbesserungspotential?" ); cy.get('[data-cy="question-7"]').should( "contain", "Was hat dir besonders gut gefallen?" ); 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="popover-yes"]') .click() .find('[data-cy="num-yes"]') .should("contain", "2"); cy.get('[data-cy="question-5"]') .find('[data-cy="popover-no"]') .click() .find('[data-cy="num-no"]') .should("contain", "1"); cy.get('[data-cy="question-6"]') .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-7"]') .should("contain", "Nur Gutes.") .should("contain", "Das Beispiel mit der Katze fand ich sehr gut") .should("contain", "Die Präsentation war super"); }); }); });