95 lines
3.1 KiB
JavaScript
95 lines
3.1 KiB
JavaScript
import { login } from "./helpers";
|
|
|
|
describe("circle page", () => {
|
|
beforeEach(() => {
|
|
cy.manageCommand("cypress_reset");
|
|
|
|
login("admin", "test");
|
|
cy.visit("/learn/unit-test-lernpfad/unit-test-circle");
|
|
});
|
|
|
|
it("can open circle page", () => {
|
|
cy.get('[data-cy="circle-title"]').should("contain", "Unit-Test Circle");
|
|
});
|
|
|
|
it("can toggle learning content", () => {
|
|
cy.get('[data-cy="circle-title"]').should("contain", "Unit-Test Circle");
|
|
|
|
cy.get(
|
|
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-ermittlung-des-kundenbedarfs"] > .cy-checkbox'
|
|
).click();
|
|
|
|
cy.get(
|
|
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-ermittlung-des-kundenbedarfs"] > .cy-checkbox-checked'
|
|
).should("have.class", "cy-checkbox-checked");
|
|
|
|
// completion data should still be there after reload
|
|
cy.reload();
|
|
cy.get(
|
|
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-ermittlung-des-kundenbedarfs"] > .cy-checkbox-checked'
|
|
).should("have.class", "cy-checkbox-checked");
|
|
});
|
|
|
|
it("can open learning contents and complete them by continuing", () => {
|
|
cy.get(
|
|
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-ermittlung-des-kundenbedarfs"]'
|
|
).click();
|
|
cy.get('[data-cy="ln-title"]').should(
|
|
"contain",
|
|
"Ermittlung des Kundenbedarfs"
|
|
);
|
|
|
|
cy.get('[data-cy="complete-and-continue"]').click();
|
|
cy.get('[data-cy="ln-title"]').should(
|
|
"contain",
|
|
"Kundenbedürfnisse erkennen"
|
|
);
|
|
|
|
cy.get('[data-cy="complete-and-continue"]').click();
|
|
cy.get('[data-cy="ln-title"]').should(
|
|
"contain",
|
|
"Was braucht eine Familie"
|
|
);
|
|
|
|
cy.get('[data-cy="complete-and-continue"]').click();
|
|
|
|
cy.get(
|
|
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-ermittlung-des-kundenbedarfs"] > .cy-checkbox-checked'
|
|
).should("have.class", "cy-checkbox-checked");
|
|
cy.get(
|
|
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-kundenbedürfnisse-erkennen"] > .cy-checkbox-checked'
|
|
).should("have.class", "cy-checkbox-checked");
|
|
cy.get(
|
|
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-was-braucht-eine-familie"] > .cy-checkbox-checked'
|
|
).should("have.class", "cy-checkbox-checked");
|
|
});
|
|
|
|
it("continue button works", () => {
|
|
cy.get('[data-cy="ls-continue-button"]').should("contain", "Los geht's");
|
|
cy.get('[data-cy="ls-continue-button"]').click();
|
|
|
|
cy.get('[data-cy="ln-title"]').should(
|
|
"contain",
|
|
'Einleitung Circle "Unit-Test Circle"'
|
|
);
|
|
cy.get('[data-cy="complete-and-continue"]').click();
|
|
|
|
cy.get('[data-cy="ls-continue-button"]').should("contain", "Weiter geht's");
|
|
cy.get('[data-cy="ls-continue-button"]').click();
|
|
cy.get('[data-cy="ln-title"]').should(
|
|
"contain",
|
|
"Ermittlung des Kundenbedarfs"
|
|
);
|
|
});
|
|
|
|
it("can open learning content by url", () => {
|
|
cy.visit(
|
|
"/learn/unit-test-lernpfad/unit-test-circle/ermittlung-des-kundenbedarfs"
|
|
);
|
|
cy.get('[data-cy="ln-title"]').should(
|
|
"contain",
|
|
"Ermittlung des Kundenbedarfs"
|
|
);
|
|
});
|
|
});
|