64 lines
2.2 KiB
JavaScript
64 lines
2.2 KiB
JavaScript
import { login } from "./helpers";
|
|
|
|
describe("learningPath page", () => {
|
|
beforeEach(() => {
|
|
cy.manageCommand("cypress_reset");
|
|
});
|
|
|
|
it("can open learningPath page", () => {
|
|
login("admin", "test");
|
|
cy.visit("/learn/versicherungsvermittlerin-lp");
|
|
|
|
cy.get('[data-cy="learning-path-title"]').should(
|
|
"contain",
|
|
"Versicherungsvermittler/in"
|
|
);
|
|
});
|
|
|
|
it("click on circle on learningPath page will open circle", () => {
|
|
login("admin", "test");
|
|
cy.visit("/learn/test-lehrgang-lp");
|
|
|
|
cy.get('[data-cy="circle-analyse"]').click({ force: true });
|
|
|
|
cy.url().should("include", "/learn/test-lehrgang-lp/analyse");
|
|
cy.get('[data-cy="circle-title"]').should("contain", "Analyse");
|
|
});
|
|
|
|
it("open listView and click on circle will open circle", () => {
|
|
login("admin", "test");
|
|
cy.visit("/learn/test-lehrgang-lp");
|
|
|
|
cy.get('[data-cy="show-list-view"]').click();
|
|
cy.get('[data-cy="full-screen-modal"]').should("be.visible");
|
|
|
|
cy.get('[data-cy="circle-analyse-vertical"]').click({ force: true });
|
|
|
|
cy.url().should("include", "/learn/test-lehrgang-lp/analyse");
|
|
cy.get('[data-cy="circle-title"]').should("contain", "Analyse");
|
|
});
|
|
|
|
it("weiter gehts button will open next circle", () => {
|
|
login("admin", "test");
|
|
cy.visit("/learn/test-lehrgang-lp");
|
|
|
|
// first click will open first circle
|
|
cy.get('[data-cy="lp-continue-button"]').should("contain", "Los geht's");
|
|
cy.get('[data-cy="lp-continue-button"]').click();
|
|
cy.get('[data-cy="circle-title"]').should("contain", "Basis");
|
|
cy.get('[data-cy="back-to-learning-path-button"]').click();
|
|
|
|
// mark a learning content in second circle
|
|
cy.get('[data-cy="circle-analyse"]').click({ force: true });
|
|
cy.get(
|
|
'[data-cy="test-lehrgang-lp-circle-analyse-lc-fachcheck-fahrzeug"] > .cy-checkbox'
|
|
).click();
|
|
cy.get('[data-cy="back-to-learning-path-button"]').click();
|
|
|
|
// click on continue should go to unit-test-circle
|
|
cy.get('[data-cy="lp-continue-button"]').should("contain", "Weiter geht's");
|
|
cy.get('[data-cy="lp-continue-button"]').click();
|
|
cy.get('[data-cy="circle-title"]').should("contain", "Analyse");
|
|
});
|
|
});
|