Cypress tests

This commit is contained in:
Daniel Egger 2022-09-14 15:51:08 +02:00
parent a3171da28d
commit b7eb88e4d5
5 changed files with 38 additions and 7 deletions

View File

@ -27,14 +27,14 @@ const block = computed(() => {
<button
type="button"
class="btn-text inline-flex items-center px-3 py-2 font-normal"
data-cy="close-learnng-content"
data-cy="close-learning-content"
@click="circleStore.closeLearningContent()"
>
<it-icon-arrow-left class="-ml-1 mr-1 h-5 w-5"></it-icon-arrow-left>
<span class="hidden lg:inline">zurück zum Circle</span>
</button>
<h1 class="text-xl hidden lg:block">{{ learningContent?.title }}</h1>
<h1 class="text-xl hidden lg:block" data-cy="ln-title">{{ learningContent?.title }}</h1>
<button
type="button"

View File

@ -101,6 +101,7 @@ const learningSequenceBorderClass = computed(() => {
<button
v-if="learningContent.translation_key === continueTranslationKeyTuple[0]"
class="btn-blue -my-4"
data-cy="ls-continue-button"
@click.stop="circleStore.openLearningContent(learningContent)"
>
<span v-if="continueTranslationKeyTuple[1]"> Los geht's </span>

View File

@ -89,7 +89,7 @@ const createContinueUrl = (learningPath: LearningPath) => {
<router-link
class="mt-4 btn-blue"
:to="createContinueUrl(learningPathStore.learningPath)[0]"
data-cy="continue-button"
data-cy="lp-continue-button"
translate
>
<span v-if="createContinueUrl(learningPathStore.learningPath)[1]"> Los geht's </span>

View File

@ -39,7 +39,7 @@ describe("circle page", () => {
cy.get('[data-cy="complete-and-continue"]').click();
cy.get('[data-cy="complete-and-continue"]').click();
cy.get('[data-cy="close-learnng-content"]').click();
cy.get('[data-cy="close-learning-content"]').click();
cy.get(
'[data-cy="versicherungsvermittlerin-circle-analyse-lc-ermittlung-des-kundenbedarfs"] > .cy-checkbox-checked'
@ -51,4 +51,32 @@ describe("circle page", () => {
'[data-cy="versicherungsvermittlerin-circle-analyse-lc-kundenbedürfnisse-erkennen"] > .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 "Analyse"'
);
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/versicherungsvermittlerin/analyse/ermittlung-des-kundenbedarfs"
);
cy.get('[data-cy="ln-title"]').should(
"contain",
"Ermittlung des Kundenbedarfs"
);
});
});

View File

@ -25,7 +25,7 @@ describe("learningPath page", () => {
cy.get('[data-cy="circle-title"]').should("contain", "Analyse");
});
it("open listView and click on cirle will open circle", () => {
it("open listView and click on circle will open circle", () => {
login("admin", "test");
cy.visit("/learn/versicherungsvermittlerin");
@ -43,7 +43,8 @@ describe("learningPath page", () => {
cy.visit("/learn/unit-test-lernpfad");
// first click will open first circle
cy.get('[data-cy="continue-button"]').click();
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();
@ -55,7 +56,8 @@ describe("learningPath page", () => {
cy.get('[data-cy="back-to-learning-path-button"]').click();
// click on continue should go to unit-test-circle
cy.get('[data-cy="continue-button"]').click();
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");
});
});