Add navigation cypress tests
This commit is contained in:
parent
f9a5f7c9a5
commit
35e629f64c
|
|
@ -65,6 +65,7 @@ function calcStepIndex(step: number) {
|
||||||
v-if="props.startBadgeText"
|
v-if="props.startBadgeText"
|
||||||
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-3xl px-3 text-sm"
|
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-3xl px-3 text-sm"
|
||||||
:class="startBadgeClasses"
|
:class="startBadgeClasses"
|
||||||
|
data-cy="nav-progress-step-start"
|
||||||
>
|
>
|
||||||
<router-link v-if="props.baseUrl" :to="`${props.baseUrl}?${props.queryParam}=0`">
|
<router-link v-if="props.baseUrl" :to="`${props.baseUrl}?${props.queryParam}=0`">
|
||||||
{{ props.startBadgeText }}
|
{{ props.startBadgeText }}
|
||||||
|
|
@ -79,6 +80,7 @@ function calcStepIndex(step: number) {
|
||||||
<div
|
<div
|
||||||
class="inline-flex h-7 w-7 items-center justify-center rounded-full px-3 py-1 text-sm"
|
class="inline-flex h-7 w-7 items-center justify-center rounded-full px-3 py-1 text-sm"
|
||||||
:class="getPillClasses(step)"
|
:class="getPillClasses(step)"
|
||||||
|
:data-cy="`nav-progress-step-${calcStepIndex(step)}`"
|
||||||
>
|
>
|
||||||
<router-link
|
<router-link
|
||||||
v-if="props.baseUrl"
|
v-if="props.baseUrl"
|
||||||
|
|
@ -94,6 +96,7 @@ function calcStepIndex(step: number) {
|
||||||
v-if="endBadgeText"
|
v-if="endBadgeText"
|
||||||
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-3xl px-3 text-sm"
|
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-3xl px-3 text-sm"
|
||||||
:class="endBadgeClasses"
|
:class="endBadgeClasses"
|
||||||
|
data-cy="nav-progress-end"
|
||||||
>
|
>
|
||||||
<router-link
|
<router-link
|
||||||
v-if="props.baseUrl"
|
v-if="props.baseUrl"
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ describe("student test", () => {
|
||||||
"Teilaufgabe 1: Beispiel einer Versicherungspolice finden"
|
"Teilaufgabe 1: Beispiel einer Versicherungspolice finden"
|
||||||
);
|
);
|
||||||
|
|
||||||
// 2 Steps forward, 1 step backwards
|
cy.learningContentMultiLayoutNextStep();
|
||||||
for (let i = 0; i !== 2; i++) {
|
cy.learningContentMultiLayoutNextStep();
|
||||||
cy.learningContentMultiLayoutNextStep();
|
cy.testLearningContentTitle("Teilaufgabe 3: Aktuelle Versicherung");
|
||||||
}
|
|
||||||
cy.learningContentMultiLayoutPreviousStep();
|
cy.learningContentMultiLayoutPreviousStep();
|
||||||
|
|
||||||
cy.testLearningContentTitle(
|
cy.testLearningContentTitle(
|
||||||
|
|
@ -66,4 +66,16 @@ describe("student test", () => {
|
||||||
"Hallovelo"
|
"Hallovelo"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("can visit sub step directly via url", () => {
|
||||||
|
cy.visit(
|
||||||
|
"/course/test-lehrgang/learn/fahrzeug/überprüfen-einer-motorfahrzeug-versicherungspolice?page=3"
|
||||||
|
);
|
||||||
|
cy.testLearningContentTitle("Teilaufgabe 3: Aktuelle Versicherung");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("can visit sub step by clicking navigation bar", () => {
|
||||||
|
cy.get('[data-cy="nav-progress-step-4"]').click();
|
||||||
|
cy.testLearningContentTitle("Teilaufgabe 4: Deine Empfehlungen");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue