fix: cypress
This commit is contained in:
parent
3011fa2ef4
commit
b8c7d22400
|
|
@ -25,7 +25,7 @@ const feedbackProviderName = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="bg-white">
|
<div class="bg-white" data-cy>
|
||||||
<!-- Top Row -->
|
<!-- Top Row -->
|
||||||
<div class="flex items-center justify-between border-b-2 border-gray-200 p-4">
|
<div class="flex items-center justify-between border-b-2 border-gray-200 p-4">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
|
|
@ -33,7 +33,10 @@ const feedbackProviderName = computed(() => {
|
||||||
<span>Circle «{{ props.summary.circle_title }}»</span>
|
<span>Circle «{{ props.summary.circle_title }}»</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="underline">
|
<span class="underline">
|
||||||
<router-link :to="props.summary.detail_url">
|
<router-link
|
||||||
|
:to="props.summary.detail_url"
|
||||||
|
:data-cy="`self-eval-${summary.id}-detail-url`"
|
||||||
|
>
|
||||||
{{ $t("a.Selbsteinschätzung anschauen") }}
|
{{ $t("a.Selbsteinschätzung anschauen") }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -47,18 +50,21 @@ const feedbackProviderName = computed(() => {
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
<SmileyCell
|
<SmileyCell
|
||||||
:count="props.summary.self_assessment.counts.pass"
|
:count="props.summary.self_assessment.counts.pass"
|
||||||
|
:cypress-identifier="`self-eval-${props.summary.id}-pass`"
|
||||||
smiley="it-icon-smiley-happy"
|
smiley="it-icon-smiley-happy"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
<SmileyCell
|
<SmileyCell
|
||||||
:count="props.summary.self_assessment.counts.fail"
|
:count="props.summary.self_assessment.counts.fail"
|
||||||
|
:cypress-identifier="`self-eval-${props.summary.id}-fail`"
|
||||||
smiley="it-icon-smiley-thinking"
|
smiley="it-icon-smiley-thinking"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
<SmileyCell
|
<SmileyCell
|
||||||
:count="props.summary.self_assessment.counts.unknown"
|
:count="props.summary.self_assessment.counts.unknown"
|
||||||
|
:cypress-identifier="`self-eval-${props.summary.id}-unknown`"
|
||||||
smiley="it-icon-smiley-neutral"
|
smiley="it-icon-smiley-neutral"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,24 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineProps<{
|
import log from "loglevel";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
count: number;
|
count: number;
|
||||||
smiley: string;
|
smiley: string;
|
||||||
|
cypressIdentifier?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
log.info("Rendering SmileyCell:", props.cypressIdentifier);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="count > 0">
|
<template v-if="count > 0">
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<component :is="smiley" class="mr-1 inline-block h-6 w-6"></component>
|
<component :is="smiley" class="mr-1 inline-block h-6 w-6"></component>
|
||||||
<p class="inline-block w-6">
|
<p class="inline-block w-6" :data-cy="cypressIdentifier">
|
||||||
{{ count }}
|
{{ count }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
|
||||||
<div />
|
|
||||||
</template>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { login } from "../helpers";
|
import {login} from "../helpers";
|
||||||
|
|
||||||
describe("selfEvaluation.cy.js", () => {
|
describe("selfEvaluation.cy.js", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
@ -28,37 +28,28 @@ describe("selfEvaluation.cy.js", () => {
|
||||||
cy.get('[data-cy="self-evaluation-success"]').should("have.text", "0");
|
cy.get('[data-cy="self-evaluation-success"]').should("have.text", "0");
|
||||||
cy.get('[data-cy="self-evaluation-unknown"]').should("have.text", "4");
|
cy.get('[data-cy="self-evaluation-unknown"]').should("have.text", "4");
|
||||||
|
|
||||||
|
|
||||||
|
// learning unit id = 687 also known as:
|
||||||
|
// Bedarfsanalyse, Ist- und Soll-Situation <<Reisen>>
|
||||||
|
const identifier = "self-eval-687"
|
||||||
|
|
||||||
// data in KompetenzNavi/Selbsteinschätzungen is correct
|
// data in KompetenzNavi/Selbsteinschätzungen is correct
|
||||||
cy.visit("/course/test-lehrgang/competence/criteria");
|
cy.visit("/course/test-lehrgang/competence/self-evaluation-and-feedback");
|
||||||
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-fail"]').should(
|
cy.get(`[data-cy="${identifier}-fail"]`).should("not.exist");
|
||||||
"have.text",
|
cy.get(`[data-cy="${identifier}-pass"]`).should("not.exist");
|
||||||
"0"
|
cy.get(`[data-cy="${identifier}-unknown"]`).should("have.text", "2");
|
||||||
);
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-success"]'
|
|
||||||
).should("have.text", "0");
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-unknown"]'
|
|
||||||
).should("have.text", "2");
|
|
||||||
|
|
||||||
// it can open self evaluation from within KompetenzNavi
|
// it can open self evaluation from within KompetenzNavi
|
||||||
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-open"]').click();
|
cy.get(`[data-cy="${identifier}-detail-url"]`).click();
|
||||||
|
|
||||||
// starting the self evaluation will return to KompetenzNavi
|
// starting the self evaluation will return to KompetenzNavi
|
||||||
cy.makeSelfEvaluation([true, false]);
|
cy.makeSelfEvaluation([true, false]);
|
||||||
cy.url().should("include", "/course/test-lehrgang/competence/criteria");
|
cy.url().should("include", "/course/test-lehrgang/competence/self-evaluation-and-feedback");
|
||||||
|
|
||||||
// check data again on KompetenzNavi
|
// check data again on KompetenzNavi
|
||||||
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-fail"]').should(
|
cy.get(`[data-cy="${identifier}-fail"]`).should("have.text", "1");
|
||||||
"have.text",
|
cy.get(`[data-cy="${identifier}-pass"]`).should("have.text", "1");
|
||||||
"1"
|
cy.get(`[data-cy="${identifier}-unknown"]`).should("not.exist");
|
||||||
);
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-success"]'
|
|
||||||
).should("have.text", "1");
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-unknown"]'
|
|
||||||
).should("have.text", "0");
|
|
||||||
|
|
||||||
// data in KompetenzNavi/Übersicht is correct
|
// data in KompetenzNavi/Übersicht is correct
|
||||||
cy.visit("/course/test-lehrgang/competence");
|
cy.visit("/course/test-lehrgang/competence");
|
||||||
|
|
@ -76,19 +67,6 @@ describe("selfEvaluation.cy.js", () => {
|
||||||
|
|
||||||
// starting the self evaluation from circle should return to circle
|
// starting the self evaluation from circle should return to circle
|
||||||
cy.url().should("include", "/course/test-lehrgang/learn/reisen");
|
cy.url().should("include", "/course/test-lehrgang/learn/reisen");
|
||||||
|
|
||||||
// data in KompetenzNavi / Selbsteinschätzungen is correct
|
|
||||||
cy.visit("/course/test-lehrgang/competence/criteria");
|
|
||||||
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-fail"]').should(
|
|
||||||
"have.text",
|
|
||||||
"0"
|
|
||||||
);
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-success"]'
|
|
||||||
).should("have.text", "2");
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-unknown"]'
|
|
||||||
).should("have.text", "0");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should be able to make a fail self evaluation", () => {
|
it("should be able to make a fail self evaluation", () => {
|
||||||
|
|
@ -97,19 +75,6 @@ describe("selfEvaluation.cy.js", () => {
|
||||||
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen"]')
|
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen"]')
|
||||||
.find('[data-cy="fail"]')
|
.find('[data-cy="fail"]')
|
||||||
.should("exist");
|
.should("exist");
|
||||||
|
|
||||||
// data in KompetenzNavi / Selbsteinschätzungen is correct
|
|
||||||
cy.visit("/course/test-lehrgang/competence/criteria");
|
|
||||||
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-fail"]').should(
|
|
||||||
"have.text",
|
|
||||||
"2"
|
|
||||||
);
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-success"]'
|
|
||||||
).should("have.text", "0");
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-unknown"]'
|
|
||||||
).should("have.text", "0");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should be able to make a mixed self evaluation", () => {
|
it("should be able to make a mixed self evaluation", () => {
|
||||||
|
|
@ -118,18 +83,5 @@ describe("selfEvaluation.cy.js", () => {
|
||||||
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen"]')
|
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen"]')
|
||||||
.find('[data-cy="fail"]')
|
.find('[data-cy="fail"]')
|
||||||
.should("exist");
|
.should("exist");
|
||||||
|
|
||||||
// data in KompetenzNavi / Selbsteinschätzungen is correct
|
|
||||||
cy.visit("/course/test-lehrgang/competence/criteria");
|
|
||||||
cy.get('[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-fail"]').should(
|
|
||||||
"have.text",
|
|
||||||
"1"
|
|
||||||
);
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-success"]'
|
|
||||||
).should("have.text", "1");
|
|
||||||
cy.get(
|
|
||||||
'[data-cy="test-lehrgang-lp-circle-reisen-lu-reisen-unknown"]'
|
|
||||||
).should("have.text", "0");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue