vbv/cypress/e2e/competence.cy.js

33 lines
1.3 KiB
JavaScript

import { login } from "./helpers";
describe("Competence", () => {
beforeEach(() => {
cy.manageCommand("cypress_reset");
login("admin", "test");
cy.visit("/learn/test-lehrgang-lp/analyse");
});
it("self evaluation should be neutral", () => {
cy.get('[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"]').find('[data-cy="unknown"]').should('exist');
});
it("should be able to make a happy self evaluation", () => {
cy.get('[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"]').click();
cy.makeSelfEvaluation([true, true])
cy.get('[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"]').find('[data-cy="success"]').should('exist');
});
it("should be able to make a fail self evaluation", () => {
cy.get('[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"]').click();
cy.makeSelfEvaluation([false, false])
cy.get('[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"]').find('[data-cy="fail"]').should('exist');
});
it("should be able to make a mixed self evaluation", () => {
cy.get('[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"]').click();
cy.makeSelfEvaluation([false, true])
cy.get('[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"]').find('[data-cy="fail"]').should('exist');
});
});