chore: adds missing cypress test for assignment
This commit is contained in:
parent
9d1328c89d
commit
1fdc28419d
|
|
@ -18,21 +18,32 @@ const progress = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BaseBox :details-link="'/statistic/assignment'">
|
<BaseBox
|
||||||
|
:details-link="'/statistic/assignment'"
|
||||||
|
data-cy="dashboard.stats.assignments"
|
||||||
|
>
|
||||||
<template #title>{{ $t("a.Kompetenznachweis-Elemente") }}</template>
|
<template #title>{{ $t("a.Kompetenznachweis-Elemente") }}</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<i18next :translation="$t('a.NUMBER Elemente abgeschlossen')">
|
<i18next :translation="$t('a.NUMBER Elemente abgeschlossen')">
|
||||||
<template #NUMBER>
|
<template #NUMBER>
|
||||||
<span class="mr-3 text-4xl font-bold">{{ assignmentsCompleted }}</span>
|
<span
|
||||||
|
class="mr-3 text-4xl font-bold"
|
||||||
|
data-cy="dashboard.stats.assignments.completed"
|
||||||
|
>
|
||||||
|
{{ assignmentsCompleted }}
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</i18next>
|
</i18next>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<i18next :translation="$t('a.{NUMBER} Bestanden')">
|
<i18next :translation="$t('a.{NUMBER} Bestanden')">
|
||||||
<template #NUMBER>
|
<template #NUMBER>
|
||||||
<span class="mr-3 text-4xl font-bold">
|
<span
|
||||||
{{ Math.round(props.avgPassed) }}%
|
class="mr-3 text-4xl font-bold"
|
||||||
|
data-cy="dashboard.stats.assignments.passed"
|
||||||
|
>
|
||||||
|
{{ `${Math.round(props.avgPassed)}%` }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</i18next>
|
</i18next>
|
||||||
|
|
|
||||||
|
|
@ -1,81 +1,101 @@
|
||||||
import {login} from "../helpers";
|
import {login} from "../helpers";
|
||||||
|
|
||||||
const getDashboardStatistics = (what) => {
|
const getDashboardStatistics = (what) => {
|
||||||
return cy.get(`[data-cy="dashboard.stats.${what}"]`);
|
return cy.get(`[data-cy="dashboard.stats.${what}"]`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickOnDetailsLink = (within) => {
|
const clickOnDetailsLink = (within) => {
|
||||||
cy.get(`[data-cy="dashboard.stats.${within}"]`).within(() => {
|
cy.get(`[data-cy="dashboard.stats.${within}"]`).within(() => {
|
||||||
cy.get('[data-cy="basebox.detailsLink"]').click();
|
cy.get('[data-cy="basebox.detailsLink"]').click();
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
describe("dashboardSupervisor.cy.js", () => {
|
describe("dashboardSupervisor.cy.js", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.manageCommand("cypress_reset --create-assignment-evaluation --create-feedback-responses --create-course-completion-performance-criteria --create-attendance-days");
|
cy.manageCommand("cypress_reset --create-assignment-evaluation --create-feedback-responses --create-course-completion-performance-criteria --create-attendance-days");
|
||||||
login("test-supervisor1@example.com", "test");
|
login("test-supervisor1@example.com", "test");
|
||||||
cy.visit("/");
|
cy.visit("/");
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("assignment summary box", () => {
|
||||||
|
it("contains correct numbers", () => {
|
||||||
|
// we have no completed assignments, but some are in progress
|
||||||
|
// -> makes sure that the numbers are correct
|
||||||
|
getDashboardStatistics("assignments.completed").should("have.text", "0");
|
||||||
|
getDashboardStatistics("assignments.passed").should("have.text", "0%");
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("attendance day summary box", () => {
|
it("contains correct details link", () => {
|
||||||
it("contains correct numbers", () => {
|
clickOnDetailsLink("assignments");
|
||||||
getDashboardStatistics("attendance.dayCompleted").should("have.text", "1");
|
|
||||||
getDashboardStatistics("attendance.participantsPresent").should("have.text", "34%");
|
|
||||||
});
|
|
||||||
it("contains correct details link", () => {
|
|
||||||
clickOnDetailsLink("attendance");
|
|
||||||
cy.url().should("contain", "/statistic/attendance");
|
|
||||||
|
|
||||||
// might be improved: roughly check
|
// might be improved: roughly check
|
||||||
// that the correct data is displayed
|
// that the correct data is displayed
|
||||||
cy.contains("Durchführung «Test Bern 2022 a»");
|
cy.contains("Noch nicht bestätigt");
|
||||||
cy.contains("Circle «Fahrzeug»");
|
cy.contains("Fahrzeug - Mein erstes Auto");
|
||||||
cy.contains("Termin: 31. Oktober 2000");
|
cy.contains("Test Bern 2022 a");
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("attendance day summary box", () => {
|
||||||
describe("overall summary box", () => {
|
it("contains correct numbers", () => {
|
||||||
it("contains correct numbers (members, experts etc.)", () => {
|
getDashboardStatistics("attendance.dayCompleted").should("have.text", "1");
|
||||||
getDashboardStatistics("participant.count").should("have.text", "4");
|
getDashboardStatistics("attendance.participantsPresent").should("have.text", "34%");
|
||||||
getDashboardStatistics("expert.count").should("have.text", "2");
|
|
||||||
getDashboardStatistics("session.count").should("have.text", "2");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
it("contains correct details link", () => {
|
||||||
|
clickOnDetailsLink("attendance");
|
||||||
|
cy.url().should("contain", "/statistic/attendance");
|
||||||
|
|
||||||
describe("feedback summary box", () => {
|
// might be improved: roughly check
|
||||||
it("contains correct numbers", () => {
|
// that the correct data is displayed
|
||||||
getDashboardStatistics("feedback.average").should("have.text", "3.3");
|
cy.contains("Durchführung «Test Bern 2022 a»");
|
||||||
getDashboardStatistics("feedback.count").should("have.text", "3");
|
cy.contains("Circle «Fahrzeug»");
|
||||||
|
cy.contains("Termin: 31. Oktober 2000");
|
||||||
});
|
|
||||||
it("contains correct details link", () => {
|
|
||||||
clickOnDetailsLink("feedback");
|
|
||||||
cy.url().should("contain", "/statistic/feedback");
|
|
||||||
|
|
||||||
// might be improved: roughly check
|
|
||||||
// that the correct data is displayed
|
|
||||||
cy.contains("3.3 von 4");
|
|
||||||
cy.contains("Test Trainer1");
|
|
||||||
cy.contains("Durchführung «Test Bern 2022 a»")
|
|
||||||
cy.contains("Circle «Fahrzeug»")
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("competence summary box", () => {
|
|
||||||
it("contains correct numbers", () => {
|
|
||||||
getDashboardStatistics("competence.success").should("have.text", "1");
|
|
||||||
getDashboardStatistics("competence.fail").should("have.text", "0");
|
|
||||||
});
|
|
||||||
it("contains correct details link", () => {
|
|
||||||
clickOnDetailsLink("competence");
|
|
||||||
cy.url().should("contain", "/statistic/competence");
|
|
||||||
|
|
||||||
// might be improved: roughly check
|
describe("overall summary box", () => {
|
||||||
// that the correct data is displayed
|
it("contains correct numbers (members, experts etc.)", () => {
|
||||||
cy.contains("Selbsteinschätzung: Vorbereitung");
|
getDashboardStatistics("participant.count").should("have.text", "4");
|
||||||
cy.contains("Durchführung «Test Bern 2022 a»");
|
getDashboardStatistics("expert.count").should("have.text", "2");
|
||||||
cy.contains("Circle «Fahrzeug»")
|
getDashboardStatistics("session.count").should("have.text", "2");
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("feedback summary box", () => {
|
||||||
|
it("contains correct numbers", () => {
|
||||||
|
getDashboardStatistics("feedback.average").should("have.text", "3.3");
|
||||||
|
getDashboardStatistics("feedback.count").should("have.text", "3");
|
||||||
|
|
||||||
|
});
|
||||||
|
it("contains correct details link", () => {
|
||||||
|
clickOnDetailsLink("feedback");
|
||||||
|
cy.url().should("contain", "/statistic/feedback");
|
||||||
|
|
||||||
|
// might be improved: roughly check
|
||||||
|
// that the correct data is displayed
|
||||||
|
cy.contains("3.3 von 4");
|
||||||
|
cy.contains("Test Trainer1");
|
||||||
|
cy.contains("Durchführung «Test Bern 2022 a»")
|
||||||
|
cy.contains("Circle «Fahrzeug»")
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("competence summary box", () => {
|
||||||
|
it("contains correct numbers", () => {
|
||||||
|
getDashboardStatistics("competence.success").should("have.text", "1");
|
||||||
|
getDashboardStatistics("competence.fail").should("have.text", "0");
|
||||||
|
});
|
||||||
|
it("contains correct details link", () => {
|
||||||
|
clickOnDetailsLink("competence");
|
||||||
|
cy.url().should("contain", "/statistic/competence");
|
||||||
|
|
||||||
|
// might be improved: roughly check
|
||||||
|
// that the correct data is displayed
|
||||||
|
cy.contains("Selbsteinschätzung: Vorbereitung");
|
||||||
|
cy.contains("Durchführung «Test Bern 2022 a»");
|
||||||
|
cy.contains("Circle «Fahrzeug»")
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue