Fix cypress tests
This commit is contained in:
parent
134d1f05d6
commit
15b5223dc5
|
|
@ -208,7 +208,7 @@ const profileDropdownData: DropdownListItem[] = [
|
|||
Shop
|
||||
</a>
|
||||
<router-link
|
||||
to="/media/versicherungsvermittlerin-media"
|
||||
to="/media/versicherungsvermittler-in-media"
|
||||
class="nav-item"
|
||||
:class="{ 'nav-item--active': inMediaLibrary() }"
|
||||
data-cy="medialibrary-link"
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ const clickLink = (to: string | undefined) => {
|
|||
</a>
|
||||
</li>
|
||||
<li class="mt-6">
|
||||
<button @click="clickLink(`/media/versicherungsvermittlerin-media`)">
|
||||
<button @click="clickLink(`/media/versicherungsvermittler-in-media`)">
|
||||
{{ $t("mediaLibrary.title") }}
|
||||
</button>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ describe("circle page", () => {
|
|||
cy.manageCommand("cypress_reset");
|
||||
|
||||
login("admin", "test");
|
||||
cy.visit("/learn/test-lehrgang-lp/analyse");
|
||||
cy.visit("/course/test-lehrgang/learn/analyse");
|
||||
});
|
||||
|
||||
it("can open circle page", () => {
|
||||
|
|
@ -92,7 +92,7 @@ describe("circle page", () => {
|
|||
});
|
||||
|
||||
it("can open learning content by url", () => {
|
||||
cy.visit("/learn/test-lehrgang-lp/analyse/reiseversicherung");
|
||||
cy.visit("/course/test-lehrgang/learn/analyse/reiseversicherung");
|
||||
cy.get('[data-cy="ln-title"]').should("contain", "Reiseversicherung");
|
||||
|
||||
cy.get('[data-cy="close-learning-content"]').click();
|
||||
|
|
|
|||
|
|
@ -5,28 +5,50 @@ describe("Competence", () => {
|
|||
cy.manageCommand("cypress_reset");
|
||||
|
||||
login("admin", "test");
|
||||
cy.visit("/learn/test-lehrgang-lp/analyse");
|
||||
cy.visit("/course/versicherungsvermittler-in/learn/analyse");
|
||||
});
|
||||
|
||||
it("self evaluation should be neutral", () => {
|
||||
cy.get('[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"]').find('[data-cy="unknown"]').should('exist');
|
||||
cy.get(
|
||||
'[data-cy="versicherungsvermittler-in-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');
|
||||
cy.get(
|
||||
'[data-cy="versicherungsvermittler-in-lp-circle-analyse-lu-fahrzeug"]'
|
||||
).click();
|
||||
cy.makeSelfEvaluation([true, true, true]);
|
||||
cy.get(
|
||||
'[data-cy="versicherungsvermittler-in-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');
|
||||
cy.get(
|
||||
'[data-cy="versicherungsvermittler-in-lp-circle-analyse-lu-fahrzeug"]'
|
||||
).click();
|
||||
cy.makeSelfEvaluation([false, false, false]);
|
||||
cy.get(
|
||||
'[data-cy="versicherungsvermittler-in-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');
|
||||
cy.get(
|
||||
'[data-cy="versicherungsvermittler-in-lp-circle-analyse-lu-fahrzeug"]'
|
||||
).click();
|
||||
cy.makeSelfEvaluation([false, true, true]);
|
||||
cy.get(
|
||||
'[data-cy="versicherungsvermittler-in-lp-circle-analyse-lu-fahrzeug"]'
|
||||
)
|
||||
.find('[data-cy="fail"]')
|
||||
.should("exist");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ describe("learningPath page", () => {
|
|||
|
||||
it("can open learningPath page", () => {
|
||||
login("admin", "test");
|
||||
cy.visit("/learn/versicherungsvermittler-in-lp");
|
||||
cy.visit("/course/versicherungsvermittler-in/learn");
|
||||
|
||||
cy.get('[data-cy="learning-path-title"]').should(
|
||||
"contain",
|
||||
|
|
@ -15,32 +15,38 @@ describe("learningPath page", () => {
|
|||
);
|
||||
});
|
||||
|
||||
it("click on circle on learningPath page will open circle", () => {
|
||||
it("/course/versicherungsvermittler-in/learn", () => {
|
||||
login("admin", "test");
|
||||
cy.visit("/learn/test-lehrgang-lp");
|
||||
cy.visit("/course/versicherungsvermittler-in/learn");
|
||||
|
||||
cy.get('[data-cy="circle-analyse"]').click({ force: true });
|
||||
|
||||
cy.url().should("include", "/learn/test-lehrgang-lp/analyse");
|
||||
cy.url().should(
|
||||
"include",
|
||||
"/course/versicherungsvermittler-in/learn/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.visit("/course/versicherungsvermittler-in/learn");
|
||||
|
||||
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.url().should(
|
||||
"include",
|
||||
"/course/versicherungsvermittler-in/learn/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");
|
||||
cy.visit("/course/versicherungsvermittler-in/learn");
|
||||
|
||||
// first click will open first circle
|
||||
cy.get('[data-cy="lp-continue-button"]').should("contain", "Los geht's");
|
||||
|
|
@ -51,7 +57,7 @@ describe("learningPath page", () => {
|
|||
// 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-checkbox"] > .cy-checkbox'
|
||||
'[data-cy="versicherungsvermittler-in-lp-circle-analyse-lc-fachcheck-fahrzeug-checkbox"] > .cy-checkbox'
|
||||
).click();
|
||||
cy.get('[data-cy="back-to-learning-path-button"]').click();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
import { login } from "./helpers";
|
||||
|
||||
describe("login", () => {
|
||||
Cypress.on("uncaught:exception", (err, runnable) => {
|
||||
// do not fail on failed requests during tests
|
||||
return false;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
cy.manageCommand("cypress_reset");
|
||||
});
|
||||
|
|
@ -31,7 +36,7 @@ describe("login", () => {
|
|||
});
|
||||
|
||||
it("login will redirect to requestet page", () => {
|
||||
cy.visit("/learn/versicherungsvermittler-in-lp");
|
||||
cy.visit("/course/versicherungsvermittler-in/learn");
|
||||
cy.get("h1").should("contain", "Login");
|
||||
|
||||
cy.get("#username").type("admin");
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ describe("MediaLibrary", () => {
|
|||
cy.manageCommand("cypress_reset");
|
||||
|
||||
login("admin", "test");
|
||||
cy.visit("/learn/test-lehrgang-lp/analyse");
|
||||
cy.visit("/");
|
||||
});
|
||||
|
||||
it("should be accessible", () => {
|
||||
cy.get('[data-cy="medialibrary-link"]').click();
|
||||
cy.get('[data-cy="Handlungsfelder-link"]').click();
|
||||
cy.get('[data-cy="Fahrzeug-link"]').click();
|
||||
cy.get('[data-cy="hf-title"]').should('contain', 'Fahrzeug')
|
||||
cy.get('[data-cy="hf-title"]').should("contain", "Fahrzeug");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,5 +6,4 @@ from vbv_lernwelt.course.models import CourseCompletion
|
|||
@click.command()
|
||||
def command():
|
||||
print("cypress reset data")
|
||||
|
||||
CourseCompletion.objects.all().delete()
|
||||
|
|
|
|||
|
|
@ -811,7 +811,7 @@ def create_standard_learning_unit(
|
|||
(
|
||||
"media_library",
|
||||
MediaLibraryBlockFactory(
|
||||
url=f"/media/versicherungsvermittlerin-media/category/{slugify(category_name)}"
|
||||
url=f"/media/versicherungsvermittler-in-media/category/{slugify(category_name)}"
|
||||
),
|
||||
)
|
||||
],
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class RelativeLinkBlockFactory(wagtail_factories.StructBlockFactory):
|
|||
description = "Platzhalter Querverweis"
|
||||
link_display_text = "Handlungsfeld anzeigen"
|
||||
icon_url = "/static/icons/demo/icon-hf-reisen.svg"
|
||||
url = "/media/versicherungsvermittlerin-media/category/fahrzeug"
|
||||
url = "/media/versicherungsvermittler-in-media/category/fahrzeug"
|
||||
# TODO: page = blocks.PageChooserBlock zu Handlungsfeld
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue