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) { function verifyExportFileExists(fileName) {
const downloadsFolder = Cypress.config("downloadsFolder"); const downloadsFolder = Cypress.config("downloadsFolder");
cy.readFile( cy.readFile(
path.join(downloadsFolder, `${fileName}_${getCurrentDate()}.xlsx`) path.join(downloadsFolder, `${fileName}_${getCurrentDate()}.xlsx`),
).should("exist"); ).should("exist");
} }
@ -39,7 +39,7 @@ function testExport(url, fileName) {
describe("dashboardExport.cy.js", () => { describe("dashboardExport.cy.js", () => {
beforeEach(() => { beforeEach(() => {
cy.manageCommand( 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", () => { it("should download the competence elements export", () => {
testExport( testExport(
"/statistic/test-lehrgang/assignment", "/statistic/test-lehrgang/assignment",
"export_kompetenznachweis_elemente" "export_kompetenznachweis_elemente",
); );
}); });
it("should download the feedback export", () => { it("should download the feedback export", () => {
testExport("/statistic/test-lehrgang/feedback", "export_feedback"); testExport("/statistic/test-lehrgang/feedback", "export_feedback");
}); });
it("should download the person export", () => {
testExport("/statistic/dashboard/persons", "export_personen");
});
}); });
describe("as trainer", () => { describe("as trainer", () => {
@ -76,12 +80,16 @@ describe("dashboardExport.cy.js", () => {
it("should download the competence elements export", () => { it("should download the competence elements export", () => {
testExport( testExport(
"/statistic/test-lehrgang/assignment", "/statistic/test-lehrgang/assignment",
"export_kompetenznachweis_elemente" "export_kompetenznachweis_elemente",
); );
}); });
it("should download the feedback export", () => { it("should download the feedback export", () => {
testExport("/statistic/test-lehrgang/feedback", "export_feedback"); 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" msgstr "Numéro de contrat d'apprentissage"
#: vbv_lernwelt/dashboard/person_export.py:16 #: vbv_lernwelt/dashboard/person_export.py:16
#, fuzzy
#| msgid "export_anwesenheit" #| msgid "export_anwesenheit"
msgid "export_personen" msgid "export_personen"
msgstr "export_presence" msgstr "export_personnes"
#: vbv_lernwelt/dashboard/person_export.py:68 #: vbv_lernwelt/dashboard/person_export.py:68
msgid "Telefon" msgid "Telefon"

View File

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