Add cypress test for cockpit
This commit is contained in:
parent
aa4f0a0d92
commit
ec4da1b265
|
|
@ -164,6 +164,7 @@ const getIconName = (lc: LearningContent) => {
|
|||
v-for="submittable in submittables"
|
||||
:key="submittable.id"
|
||||
class="flex flex-col justify-between gap-2 py-4 lg:flex-row lg:gap-4"
|
||||
:data-cy="`submittable-${submittable.content.slug}`"
|
||||
>
|
||||
<div class="flex flex-row items-center gap-2 lg:w-1/3">
|
||||
<div class="min-h-9 min-w-9">
|
||||
|
|
|
|||
|
|
@ -49,7 +49,10 @@ const total = (metrics: AssignmentCompletionMetricsType) => {
|
|||
:items="courseStatistics.assignments.records"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<div class="flex justify-between" :data-cy="item.assignment_title">
|
||||
<div
|
||||
class="flex justify-between"
|
||||
:data-cy=" (item as AssignmentStatisticsRecordType).assignment_title"
|
||||
>
|
||||
<div>
|
||||
<h4 class="font-bold">
|
||||
{{ (item as AssignmentStatisticsRecordType).assignment_title }}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
import { login } from "../helpers";
|
||||
|
||||
describe("cockpitPointsDeducted.cy.js", () => {
|
||||
it("will show results with points", () => {
|
||||
cy.manageCommand(
|
||||
"cypress_reset --create-assignment-evaluation --assignment-evaluation-scores 6,4,6,3,3 --create-edoniq-test-results 19 24 0"
|
||||
);
|
||||
login("test-trainer1@example.com", "test");
|
||||
cy.visit("/course/test-lehrgang/cockpit");
|
||||
|
||||
// check edoniq test with deducted points
|
||||
cy.get(
|
||||
'[data-cy="submittable-test-lehrgang-lp-circle-fahrzeug-lc-wissens-und-verständnisfragen"]'
|
||||
).should("contain", "1 von 3 Bewertungen freigegeben");
|
||||
cy.get(
|
||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-wissens-und-verständnisfragen"]'
|
||||
).click();
|
||||
cy.get('[data-cy="Student1"]')
|
||||
.should("contain", "19 von 24 Punkten")
|
||||
.and("contain", "79%")
|
||||
.and("not.contain", "Nicht bestanden");
|
||||
|
||||
// check casework with deducted points
|
||||
cy.visit("/course/test-lehrgang/cockpit");
|
||||
cy.get(
|
||||
'[data-cy="submittable-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]'
|
||||
).should("contain", "1 von 3 Bewertungen freigegeben");
|
||||
cy.get(
|
||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]'
|
||||
).click();
|
||||
cy.get('[data-cy="Student1"]')
|
||||
.should("contain", "22 von 24 Punkten")
|
||||
.and("contain", "92%")
|
||||
.and("not.contain", "Nicht bestanden");
|
||||
});
|
||||
|
||||
it("will show results with deducted points", () => {
|
||||
cy.manageCommand(
|
||||
"cypress_reset --create-assignment-evaluation --assignment-evaluation-scores 6,4,6,3,3 --assignment-points-deducted 14 --create-edoniq-test-results 19 24 8"
|
||||
);
|
||||
login("test-trainer1@example.com", "test");
|
||||
cy.visit("/course/test-lehrgang/cockpit");
|
||||
|
||||
// check edoniq test with deducted points
|
||||
cy.get(
|
||||
'[data-cy="submittable-test-lehrgang-lp-circle-fahrzeug-lc-wissens-und-verständnisfragen"]'
|
||||
).should("contain", "1 von 3 Bewertungen freigegeben");
|
||||
cy.get(
|
||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-wissens-und-verständnisfragen"]'
|
||||
).click();
|
||||
cy.get('[data-cy="Student1"]')
|
||||
.should("contain", "11 von 24 Punkten")
|
||||
.and("contain", "46%")
|
||||
.and("contain", "Nicht bestanden");
|
||||
|
||||
// check casework with deducted points
|
||||
cy.visit("/course/test-lehrgang/cockpit");
|
||||
cy.get(
|
||||
'[data-cy="submittable-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]'
|
||||
).should("contain", "1 von 3 Bewertungen freigegeben");
|
||||
cy.get(
|
||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]'
|
||||
).click();
|
||||
cy.get('[data-cy="Student1"]')
|
||||
.should("contain", "8 von 24 Punkten")
|
||||
.and("contain", "33%")
|
||||
.and("contain", "Nicht bestanden");
|
||||
});
|
||||
});
|
||||
|
|
@ -106,7 +106,7 @@ describe("dashboardSupervisor.cy.js", () => {
|
|||
describe("with deducted points", () => {
|
||||
beforeEach(() => {
|
||||
cy.manageCommand(
|
||||
"cypress_reset --create-assignment-evaluation --assignment-evaluation-scores 4,6,4,3,2 --assignment-points-deducted 5 --create-edoniq-test-results 19 24 8"
|
||||
"cypress_reset --create-assignment-evaluation --assignment-evaluation-scores 6,6,6,3,3 --assignment-points-deducted 14 --create-edoniq-test-results 19 24 8"
|
||||
);
|
||||
login("test-supervisor1@example.com", "test");
|
||||
cy.visit("/");
|
||||
|
|
@ -116,7 +116,7 @@ describe("dashboardSupervisor.cy.js", () => {
|
|||
// we have no completed assignments, but some are in progress
|
||||
// -> makes sure that the numbers are correct
|
||||
getDashboardStatistics("assignments.completed").should("have.text", "2");
|
||||
getDashboardStatistics("assignments.passed").should("have.text", "17%");
|
||||
getDashboardStatistics("assignments.passed").should("have.text", "0%");
|
||||
|
||||
// check data on the details page
|
||||
cy.get(
|
||||
|
|
@ -128,7 +128,7 @@ describe("dashboardSupervisor.cy.js", () => {
|
|||
|
||||
cy.get(
|
||||
'[data-cy="Überprüfen einer Motorfahrzeugs-Versicherungspolice"]'
|
||||
).should("contain", "1 von 3 bestanden");
|
||||
).should("contain", "0 von 3 bestanden");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -35,4 +35,9 @@ class Migration(migrations.Migration):
|
|||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="assignmentcompletion",
|
||||
name="completion_data",
|
||||
field=models.JSONField(blank=True, default=dict),
|
||||
),
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue