Add cypress tests

This commit is contained in:
Christian Cueni 2024-07-16 16:17:12 +02:00
parent dc4af21e00
commit 35e5067331
4 changed files with 14 additions and 7 deletions

View File

@ -26,7 +26,7 @@ function getCurrentDate() {
function verifyExportFileExists(fileName) {
const downloadsFolder = Cypress.config("downloadsFolder");
cy.readFile(
path.join(downloadsFolder, `${fileName}_${getCurrentDate()}.xlsx`)
path.join(downloadsFolder, `${fileName}_${getCurrentDate()}.xlsx`),
).should("exist");
}
@ -39,7 +39,7 @@ function testExport(url, fileName) {
describe("dashboardExport.cy.js", () => {
beforeEach(() => {
cy.manageCommand(
"cypress_reset --create-assignment-evaluation --create-feedback-responses --create-course-completion-performance-criteria --create-attendance-days"
"cypress_reset --create-assignment-evaluation --create-feedback-responses --create-course-completion-performance-criteria --create-attendance-days",
);
});
@ -55,13 +55,17 @@ describe("dashboardExport.cy.js", () => {
it("should download the competence elements export", () => {
testExport(
"/statistic/test-lehrgang/assignment",
"export_kompetenznachweis_elemente"
"export_kompetenznachweis_elemente",
);
});
it("should download the feedback export", () => {
testExport("/statistic/test-lehrgang/feedback", "export_feedback");
});
it("should download the person export", () => {
testExport("/statistic/dashboard/persons", "export_personen");
});
});
describe("as trainer", () => {
@ -76,12 +80,16 @@ describe("dashboardExport.cy.js", () => {
it("should download the competence elements export", () => {
testExport(
"/statistic/test-lehrgang/assignment",
"export_kompetenznachweis_elemente"
"export_kompetenznachweis_elemente",
);
});
it("should download the feedback export", () => {
testExport("/statistic/test-lehrgang/feedback", "export_feedback");
});
it("should download the person export", () => {
testExport("/statistic/dashboard/persons", "export_personen");
});
});
});

View File

@ -162,10 +162,9 @@ msgid "Lehrvertragsnummer"
msgstr "Numéro de contrat d'apprentissage"
#: vbv_lernwelt/dashboard/person_export.py:16
#, fuzzy
#| msgid "export_anwesenheit"
msgid "export_personen"
msgstr "export_presence"
msgstr "export_personnes"
#: vbv_lernwelt/dashboard/person_export.py:68
msgid "Telefon"

View File

@ -165,7 +165,7 @@ msgstr "Numero di contratto di tirocinio"
#, fuzzy
#| msgid "export_anwesenheit"
msgid "export_personen"
msgstr "esportazione_presenza"
msgstr "esportazione_persone"
#: vbv_lernwelt/dashboard/person_export.py:68
msgid "Telefon"