Fix cypress tests
This commit is contained in:
parent
659684f25b
commit
3bd604215a
|
|
@ -5,62 +5,49 @@ describe("circle page", () => {
|
|||
cy.manageCommand("cypress_reset");
|
||||
|
||||
login("admin", "test");
|
||||
cy.visit("/learn/unit-test-lernpfad/unit-test-circle");
|
||||
cy.visit("/learn/test-lehrgang-lp/analyse");
|
||||
});
|
||||
|
||||
it("can open circle page", () => {
|
||||
cy.get('[data-cy="circle-title"]').should("contain", "Unit-Test Circle");
|
||||
cy.get('[data-cy="circle-title"]').should("contain", "Analyse");
|
||||
});
|
||||
|
||||
it("can toggle learning content", () => {
|
||||
cy.get('[data-cy="circle-title"]').should("contain", "Unit-Test Circle");
|
||||
cy.get('[data-cy="circle-title"]').should("contain", "Analyse");
|
||||
|
||||
cy.get(
|
||||
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-ermittlung-des-kundenbedarfs"] > .cy-checkbox'
|
||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-einleitung-circle-analyse"] > .cy-checkbox'
|
||||
).click();
|
||||
|
||||
cy.get(
|
||||
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-ermittlung-des-kundenbedarfs"] > .cy-checkbox-checked'
|
||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-einleitung-circle-analyse"] > .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'
|
||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-einleitung-circle-analyse"] > .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"]'
|
||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-rafael-fasel-wechselt-sein-auto"]'
|
||||
).click();
|
||||
cy.get('[data-cy="ln-title"]').should(
|
||||
"contain",
|
||||
"Ermittlung des Kundenbedarfs"
|
||||
"Rafael Fasel wechselt sein Auto"
|
||||
);
|
||||
|
||||
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="ln-title"]').should("contain", "Fachcheck Fahrzeug");
|
||||
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'
|
||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-rafael-fasel-wechselt-sein-auto"] > .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'
|
||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-fachcheck-fahrzeug"] > .cy-checkbox-checked'
|
||||
).should("have.class", "cy-checkbox-checked");
|
||||
});
|
||||
|
||||
|
|
@ -70,7 +57,7 @@ describe("circle page", () => {
|
|||
|
||||
cy.get('[data-cy="ln-title"]').should(
|
||||
"contain",
|
||||
'Einleitung Circle "Unit-Test Circle"'
|
||||
'Einleitung Circle "Analyse"'
|
||||
);
|
||||
cy.get('[data-cy="complete-and-continue"]').click();
|
||||
|
||||
|
|
@ -78,17 +65,15 @@ describe("circle page", () => {
|
|||
cy.get('[data-cy="ls-continue-button"]').click();
|
||||
cy.get('[data-cy="ln-title"]').should(
|
||||
"contain",
|
||||
"Ermittlung des Kundenbedarfs"
|
||||
"Rafael Fasel wechselt sein Auto"
|
||||
);
|
||||
});
|
||||
|
||||
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"
|
||||
);
|
||||
cy.visit("/learn/test-lehrgang-lp/analyse/reiseversicherung");
|
||||
cy.get('[data-cy="ln-title"]').should("contain", "Reiseversicherung");
|
||||
|
||||
cy.get('[data-cy="close-learning-content"]').click();
|
||||
cy.get('[data-cy="circle-title"]').should("contain", "Analyse");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ describe("learningPath page", () => {
|
|||
|
||||
it("can open learningPath page", () => {
|
||||
login("admin", "test");
|
||||
cy.visit("/learn/versicherungsvermittlerin");
|
||||
cy.visit("/learn/versicherungsvermittlerin-lp");
|
||||
|
||||
cy.get('[data-cy="learning-path-title"]').should(
|
||||
"contain",
|
||||
|
|
@ -17,30 +17,30 @@ describe("learningPath page", () => {
|
|||
|
||||
it("click on circle on learningPath page will open circle", () => {
|
||||
login("admin", "test");
|
||||
cy.visit("/learn/versicherungsvermittlerin");
|
||||
cy.visit("/learn/test-lehrgang-lp");
|
||||
|
||||
cy.get('[data-cy="circle-analyse"]').click({ force: true });
|
||||
|
||||
cy.url().should("include", "/learn/versicherungsvermittlerin/analyse");
|
||||
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/versicherungsvermittlerin");
|
||||
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/versicherungsvermittlerin/analyse");
|
||||
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/unit-test-lernpfad");
|
||||
cy.visit("/learn/test-lehrgang-lp");
|
||||
|
||||
// first click will open first circle
|
||||
cy.get('[data-cy="lp-continue-button"]').should("contain", "Los geht's");
|
||||
|
|
@ -49,15 +49,15 @@ describe("learningPath page", () => {
|
|||
cy.get('[data-cy="back-to-learning-path-button"]').click();
|
||||
|
||||
// mark a learning content in second circle
|
||||
cy.get('[data-cy="circle-unit-test-circle"]').click({ force: true });
|
||||
cy.get('[data-cy="circle-analyse"]').click({ force: true });
|
||||
cy.get(
|
||||
'[data-cy="unit-test-lernpfad-circle-unit-test-circle-lc-reiseversicherung"] > .cy-checkbox'
|
||||
'[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", "Unit-Test Circle");
|
||||
cy.get('[data-cy="circle-title"]').should("contain", "Analyse");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ describe("login", () => {
|
|||
});
|
||||
|
||||
it("login will redirect to requestet page", () => {
|
||||
cy.visit("/learn/versicherungsvermittlerin");
|
||||
cy.visit("/learn/versicherungsvermittlerin-lp");
|
||||
cy.get("h1").should("contain", "Login");
|
||||
|
||||
cy.get("#username").type("admin");
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ def create_default_learning_path(user=None, skip_locales=True):
|
|||
|
||||
course_page = CoursePage.objects.get(course_id=COURSE_VERSICHERUNGSVERMITTLERIN_ID)
|
||||
lp = LearningPathFactory(
|
||||
title="Lernpfad",
|
||||
title="Versicherungsvermittler/in",
|
||||
parent=course_page,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue