Fix cypress tests
This commit is contained in:
parent
22b2491136
commit
998001df14
|
|
@ -158,24 +158,28 @@ const learningSequenceBorderClass = computed(() => {
|
||||||
<div
|
<div
|
||||||
v-if="learningUnit.children.length"
|
v-if="learningUnit.children.length"
|
||||||
class="hover:cursor-pointer"
|
class="hover:cursor-pointer"
|
||||||
|
:data-cy="`${learningUnit.slug}`"
|
||||||
@click="circleStore.openSelfEvaluation(learningUnit)"
|
@click="circleStore.openSelfEvaluation(learningUnit)"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="circleStore.calcSelfEvaluationStatus(learningUnit)"
|
v-if="circleStore.calcSelfEvaluationStatus(learningUnit)"
|
||||||
class="flex items-center gap-4 pb-3 lg:pb-6"
|
class="flex items-center gap-4 pb-3 lg:pb-6 self-evaluation-success"
|
||||||
>
|
>
|
||||||
<it-icon-smiley-happy class="w-8 h-8 flex-none" />
|
<it-icon-smiley-happy class="w-8 h-8 flex-none" data-cy="success" />
|
||||||
<div>Selbsteinschätzung: Ich kann das.</div>
|
<div>Selbsteinschätzung: Ich kann das.</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else-if="circleStore.calcSelfEvaluationStatus(learningUnit) === false"
|
v-else-if="circleStore.calcSelfEvaluationStatus(learningUnit) === false"
|
||||||
class="flex items-center gap-4 pb-3 lg:pb-6"
|
class="flex items-center gap-4 pb-3 lg:pb-6 self-evaluation-fail"
|
||||||
>
|
>
|
||||||
<it-icon-smiley-thinking class="w-8 h-8 flex-none" />
|
<it-icon-smiley-thinking class="w-8 h-8 flex-none" data-cy="fail" />
|
||||||
<div>Selbsteinschätzung: Muss ich nochmals anschauen</div>
|
<div>Selbsteinschätzung: Muss ich nochmals anschauen</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="flex items-center gap-4 pb-3 lg:pb-6">
|
<div
|
||||||
<it-icon-smiley-neutral class="w-8 h-8 flex-none" />
|
v-else
|
||||||
|
class="flex items-center gap-4 pb-3 lg:pb-6 self-evaluation-unknown"
|
||||||
|
>
|
||||||
|
<it-icon-smiley-neutral class="w-8 h-8 flex-none" data-cy="unknown" />
|
||||||
<div>Selbsteinschätzung</div>
|
<div>Selbsteinschätzung</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,18 @@ function handleContinue() {
|
||||||
<span class="hidden lg:inline">zurück zum Circle</span>
|
<span class="hidden lg:inline">zurück zum Circle</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<h1 class="text-xl hidden lg:block">{{ learningUnit.title }}</h1>
|
<h1 class="text-xl hidden lg:block" data-cy="ln-title">
|
||||||
|
Selbsteinschätzung {{ learningUnit.title }}
|
||||||
|
</h1>
|
||||||
|
|
||||||
<button type="button" class="btn-blue" @click="handleContinue()">Weiter</button>
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn-blue"
|
||||||
|
data-cy="complete-and-continue"
|
||||||
|
@click="handleContinue()"
|
||||||
|
>
|
||||||
|
Weiter
|
||||||
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="container-medium">
|
<div class="container-medium">
|
||||||
|
|
@ -73,6 +82,7 @@ function handleContinue() {
|
||||||
'border-2': currentQuestion.completion_status === 'success',
|
'border-2': currentQuestion.completion_status === 'success',
|
||||||
'border-gray-500': currentQuestion.completion_status !== 'success',
|
'border-gray-500': currentQuestion.completion_status !== 'success',
|
||||||
}"
|
}"
|
||||||
|
data-cy="success"
|
||||||
@click="circleStore.markCompletion(currentQuestion, 'success')"
|
@click="circleStore.markCompletion(currentQuestion, 'success')"
|
||||||
>
|
>
|
||||||
<it-icon-smiley-happy class="w-16 h-16 mr-4"></it-icon-smiley-happy>
|
<it-icon-smiley-happy class="w-16 h-16 mr-4"></it-icon-smiley-happy>
|
||||||
|
|
@ -85,6 +95,7 @@ function handleContinue() {
|
||||||
'border-2': currentQuestion.completion_status === 'fail',
|
'border-2': currentQuestion.completion_status === 'fail',
|
||||||
'border-gray-500': currentQuestion.completion_status !== 'fail',
|
'border-gray-500': currentQuestion.completion_status !== 'fail',
|
||||||
}"
|
}"
|
||||||
|
data-cy="fail"
|
||||||
@click="circleStore.markCompletion(currentQuestion, 'fail')"
|
@click="circleStore.markCompletion(currentQuestion, 'fail')"
|
||||||
>
|
>
|
||||||
<it-icon-smiley-thinking class="w-16 h-16 mr-4"></it-icon-smiley-thinking>
|
<it-icon-smiley-thinking class="w-16 h-16 mr-4"></it-icon-smiley-thinking>
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@ describe("circle page", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("can open learning contents and complete them by continuing", () => {
|
it("can open learning contents and complete them by continuing", () => {
|
||||||
|
cy.get(
|
||||||
|
'[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"] > div'
|
||||||
|
).should("have.class", "self-evaluation-unknown");
|
||||||
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-rafael-fasel-wechselt-sein-auto"]'
|
'[data-cy="test-lehrgang-lp-circle-analyse-lc-rafael-fasel-wechselt-sein-auto"]'
|
||||||
).click();
|
).click();
|
||||||
|
|
@ -43,12 +47,30 @@ describe("circle page", () => {
|
||||||
cy.get('[data-cy="ln-title"]').should("contain", "Fachcheck Fahrzeug");
|
cy.get('[data-cy="ln-title"]').should("contain", "Fachcheck Fahrzeug");
|
||||||
cy.get('[data-cy="complete-and-continue"]').click();
|
cy.get('[data-cy="complete-and-continue"]').click();
|
||||||
|
|
||||||
|
cy.get('[data-cy="ln-title"]').should(
|
||||||
|
"contain",
|
||||||
|
"Selbsteinschätzung Fahrzeug"
|
||||||
|
);
|
||||||
|
cy.get('[data-cy="success"]').click();
|
||||||
|
cy.get('[data-cy="complete-and-continue"]').click();
|
||||||
|
|
||||||
|
cy.get('[data-cy="ln-title"]').should(
|
||||||
|
"contain",
|
||||||
|
"Selbsteinschätzung Fahrzeug"
|
||||||
|
);
|
||||||
|
cy.get('[data-cy="success"]').click();
|
||||||
|
cy.get('[data-cy="complete-and-continue"]').click();
|
||||||
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-rafael-fasel-wechselt-sein-auto"] > .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");
|
).should("have.class", "cy-checkbox-checked");
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="test-lehrgang-lp-circle-analyse-lc-fachcheck-fahrzeug"] > .cy-checkbox-checked'
|
'[data-cy="test-lehrgang-lp-circle-analyse-lc-fachcheck-fahrzeug"] > .cy-checkbox-checked'
|
||||||
).should("have.class", "cy-checkbox-checked");
|
).should("have.class", "cy-checkbox-checked");
|
||||||
|
|
||||||
|
cy.get(
|
||||||
|
'[data-cy="test-lehrgang-lp-circle-analyse-lu-fahrzeug"] > div'
|
||||||
|
).should("have.class", "self-evaluation-success");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("continue button works", () => {
|
it("continue button works", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue