fix: tests
This commit is contained in:
parent
742801bf22
commit
754fa52fd3
|
|
@ -1,5 +1,5 @@
|
||||||
import { TEST_TRAINER1_USER_ID } from "../../consts";
|
import {TEST_TRAINER1_USER_ID} from "../../consts";
|
||||||
import { login } from "../helpers";
|
import {EXPERT_COCKPIT_URL, login} from "../helpers";
|
||||||
|
|
||||||
describe("assignmentTrainer.cy.js", () => {
|
describe("assignmentTrainer.cy.js", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
@ -9,10 +9,8 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
|
|
||||||
describe("Casework", () => {
|
describe("Casework", () => {
|
||||||
it("can open cockpit assignment page and open user assignment", () => {
|
it("can open cockpit assignment page and open user assignment", () => {
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.get(
|
cy.get('[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]').click();
|
||||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]'
|
|
||||||
).click();
|
|
||||||
|
|
||||||
cy.get('[data-cy="Student1"]').should("contain", "Ergebnisse abgegeben");
|
cy.get('[data-cy="Student1"]').should("contain", "Ergebnisse abgegeben");
|
||||||
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
||||||
|
|
@ -22,24 +20,16 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("can start evaluation and store evaluation results", () => {
|
it("can start evaluation and store evaluation results", () => {
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL)
|
||||||
cy.get(
|
cy.get('[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]').click();
|
||||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]'
|
|
||||||
).click();
|
|
||||||
|
|
||||||
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
||||||
|
|
||||||
cy.get('[data-cy="title"]').should("contain", "Bewertung");
|
cy.get('[data-cy="title"]').should("contain", "Bewertung");
|
||||||
cy.get('[data-cy="evaluation-duedate"]').should("exist");
|
cy.get('[data-cy="evaluation-duedate"]').should("exist");
|
||||||
cy.get('[data-cy="instruction"]').should(
|
cy.get('[data-cy="instruction"]').should("contain", "Die Gesamtpunktzahl und die daraus resultierende Note wird auf Grund des hinterlegeten Beurteilungsinstrument berechnet.");
|
||||||
"contain",
|
|
||||||
"Die Gesamtpunktzahl und die daraus resultierende Note wird auf Grund des hinterlegeten Beurteilungsinstrument berechnet."
|
|
||||||
);
|
|
||||||
cy.get('[data-cy="start-evaluation"]').click();
|
cy.get('[data-cy="start-evaluation"]').click();
|
||||||
cy.get('[data-cy="evaluation-task"]').should(
|
cy.get('[data-cy="evaluation-task"]').should("contain", "Beurteilungskriterium 1 / 5");
|
||||||
"contain",
|
|
||||||
"Beurteilungskriterium 1 / 5"
|
|
||||||
);
|
|
||||||
|
|
||||||
// without text input the button should be disabled
|
// without text input the button should be disabled
|
||||||
cy.get('[data-cy="next-step"]').should("be.disabled");
|
cy.get('[data-cy="next-step"]').should("be.disabled");
|
||||||
|
|
@ -51,10 +41,7 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
cy.get('[data-cy="next-step"]').click();
|
cy.get('[data-cy="next-step"]').click();
|
||||||
|
|
||||||
cy.get('[data-cy="evaluation-task"]').should(
|
cy.get('[data-cy="evaluation-task"]').should("contain", "Beurteilungskriterium 2 / 5");
|
||||||
"contain",
|
|
||||||
"Beurteilungskriterium 2 / 5"
|
|
||||||
);
|
|
||||||
cy.get('[data-cy="subtask-2"]').click();
|
cy.get('[data-cy="subtask-2"]').click();
|
||||||
cy.get('[data-cy="reason-text"]').type("Nicht so gut");
|
cy.get('[data-cy="reason-text"]').type("Nicht so gut");
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
|
|
@ -84,36 +71,28 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
|
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
// load AssignmentCompletion from DB and check
|
// load AssignmentCompletion from DB and check
|
||||||
cy.loadAssignmentCompletion(
|
cy.loadAssignmentCompletion("evaluation_user_id", TEST_TRAINER1_USER_ID).then((ac) => {
|
||||||
"evaluation_user_id",
|
|
||||||
TEST_TRAINER1_USER_ID
|
|
||||||
).then((ac) => {
|
|
||||||
expect(ac.completion_status).to.equal("EVALUATION_IN_PROGRESS");
|
expect(ac.completion_status).to.equal("EVALUATION_IN_PROGRESS");
|
||||||
expect(JSON.stringify(ac.completion_data)).to.include("Nicht so gut");
|
expect(JSON.stringify(ac.completion_data)).to.include("Nicht so gut");
|
||||||
expect(Cypress._.values(ac.completion_data)).to.deep.include({
|
expect(Cypress._.values(ac.completion_data)).to.deep.include({
|
||||||
expert_data: { points: 2, text: "Nicht so gut" },
|
expert_data: {points: 2, text: "Nicht so gut"},
|
||||||
});
|
});
|
||||||
expect(Cypress._.values(ac.completion_data)).to.deep.include({
|
expect(Cypress._.values(ac.completion_data)).to.deep.include({
|
||||||
expert_data: { points: 4, text: "Gut gemacht!" },
|
expert_data: {points: 4, text: "Gut gemacht!"},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("can make complete evaluation", () => {
|
it("can make complete evaluation", () => {
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL)
|
||||||
cy.get(
|
cy.get('[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]').click();
|
||||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]'
|
|
||||||
).click();
|
|
||||||
|
|
||||||
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
||||||
|
|
||||||
cy.get('[data-cy="start-evaluation"]').click();
|
cy.get('[data-cy="start-evaluation"]').click();
|
||||||
|
|
||||||
// step 1
|
// step 1
|
||||||
cy.get('[data-cy="evaluation-task"]').should(
|
cy.get('[data-cy="evaluation-task"]').should("contain", "Beurteilungskriterium 1 / 5");
|
||||||
"contain",
|
|
||||||
"Beurteilungskriterium 1 / 5"
|
|
||||||
);
|
|
||||||
cy.get('[data-cy="subtask-6"]').click();
|
cy.get('[data-cy="subtask-6"]').click();
|
||||||
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 1");
|
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 1");
|
||||||
// wait for debounce
|
// wait for debounce
|
||||||
|
|
@ -121,40 +100,28 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
cy.get('[data-cy="next-step"]').click();
|
cy.get('[data-cy="next-step"]').click();
|
||||||
|
|
||||||
// step 2
|
// step 2
|
||||||
cy.get('[data-cy="evaluation-task"]').should(
|
cy.get('[data-cy="evaluation-task"]').should("contain", "Beurteilungskriterium 2 / 5");
|
||||||
"contain",
|
|
||||||
"Beurteilungskriterium 2 / 5"
|
|
||||||
);
|
|
||||||
cy.get('[data-cy="subtask-4"]').click();
|
cy.get('[data-cy="subtask-4"]').click();
|
||||||
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 2");
|
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 2");
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
cy.get('[data-cy="next-step"]').click();
|
cy.get('[data-cy="next-step"]').click();
|
||||||
|
|
||||||
// step 3
|
// step 3
|
||||||
cy.get('[data-cy="evaluation-task"]').should(
|
cy.get('[data-cy="evaluation-task"]').should("contain", "Beurteilungskriterium 3 / 5");
|
||||||
"contain",
|
|
||||||
"Beurteilungskriterium 3 / 5"
|
|
||||||
);
|
|
||||||
cy.get('[data-cy="subtask-2"]').click();
|
cy.get('[data-cy="subtask-2"]').click();
|
||||||
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 3");
|
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 3");
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
cy.get('[data-cy="next-step"]').click();
|
cy.get('[data-cy="next-step"]').click();
|
||||||
|
|
||||||
// step 4
|
// step 4
|
||||||
cy.get('[data-cy="evaluation-task"]').should(
|
cy.get('[data-cy="evaluation-task"]').should("contain", "Beurteilungskriterium 4 / 5");
|
||||||
"contain",
|
|
||||||
"Beurteilungskriterium 4 / 5"
|
|
||||||
);
|
|
||||||
cy.get('[data-cy="subtask-3"]').click();
|
cy.get('[data-cy="subtask-3"]').click();
|
||||||
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 4");
|
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 4");
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
cy.get('[data-cy="next-step"]').click();
|
cy.get('[data-cy="next-step"]').click();
|
||||||
|
|
||||||
// step 5
|
// step 5
|
||||||
cy.get('[data-cy="evaluation-task"]').should(
|
cy.get('[data-cy="evaluation-task"]').should("contain", "Beurteilungskriterium 5 / 5");
|
||||||
"contain",
|
|
||||||
"Beurteilungskriterium 5 / 5"
|
|
||||||
);
|
|
||||||
cy.get('[data-cy="subtask-2"]').click();
|
cy.get('[data-cy="subtask-2"]').click();
|
||||||
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 5");
|
cy.get('[data-cy="reason-text"]').type("Begründung Schritt 5");
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
|
|
@ -166,17 +133,12 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
cy.get('[data-cy="total-points"]').should("contain", "24");
|
cy.get('[data-cy="total-points"]').should("contain", "24");
|
||||||
cy.get('[data-cy="submit-evaluation"]').click();
|
cy.get('[data-cy="submit-evaluation"]').click();
|
||||||
|
|
||||||
cy.get('[data-cy="result-section"]').should(
|
cy.get('[data-cy="result-section"]').should("contain", "Deine Bewertung für Test Student1 wurde freigegeben");
|
||||||
"contain",
|
|
||||||
"Deine Bewertung für Test Student1 wurde freigegeben"
|
|
||||||
);
|
|
||||||
|
|
||||||
// going back to cockpit should show points for student
|
// going back to cockpit should show points for student
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.reload();
|
cy.reload();
|
||||||
cy.get(
|
cy.get('[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]').click();
|
||||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-fahrzeug-lc-überprüfen-einer-motorfahrzeug-versicherungspolice"]'
|
|
||||||
).click();
|
|
||||||
|
|
||||||
cy.get('[data-cy="Student1"]').should("contain", "Bewertung freigegeben");
|
cy.get('[data-cy="Student1"]').should("contain", "Bewertung freigegeben");
|
||||||
cy.get('[data-cy="Student1"]').should("contain", "17 von 24 Punkte");
|
cy.get('[data-cy="Student1"]').should("contain", "17 von 24 Punkte");
|
||||||
|
|
@ -186,10 +148,7 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
cy.url().should("include", "step=6");
|
cy.url().should("include", "step=6");
|
||||||
|
|
||||||
// load AssignmentCompletion from DB and check
|
// load AssignmentCompletion from DB and check
|
||||||
cy.loadAssignmentCompletion(
|
cy.loadAssignmentCompletion("evaluation_user_id", TEST_TRAINER1_USER_ID).then((ac) => {
|
||||||
"evaluation_user_id",
|
|
||||||
TEST_TRAINER1_USER_ID
|
|
||||||
).then((ac) => {
|
|
||||||
expect(ac.completion_status).to.equal("EVALUATION_SUBMITTED");
|
expect(ac.completion_status).to.equal("EVALUATION_SUBMITTED");
|
||||||
expect(ac.evaluation_points).to.equal(17);
|
expect(ac.evaluation_points).to.equal(17);
|
||||||
expect(ac.evaluation_max_points).to.equal(24);
|
expect(ac.evaluation_max_points).to.equal(24);
|
||||||
|
|
@ -207,21 +166,16 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
//Todo: Move tests to Lernbegleitung once it is implemented
|
//Todo: Move tests to Lernbegleitung once it is implemented
|
||||||
describe("Praxis Assignment", () => {
|
describe("Praxis Assignment", () => {
|
||||||
it("can start evaluation and store evaluation results", () => {
|
it("can start evaluation and store evaluation results", () => {
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.get('[data-cy="dropdown-select"]').click();
|
cy.get('[data-cy="dropdown-select"]').click();
|
||||||
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
|
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
|
||||||
cy.get(
|
cy.get('[data-cy="show-details-btn-test-lehrgang-lp-circle-reisen-lc-mein-kundenstamm"]').click();
|
||||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-reisen-lc-mein-kundenstamm"]'
|
|
||||||
).click();
|
|
||||||
|
|
||||||
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
||||||
|
|
||||||
cy.get('[data-cy="title"]').should("contain", "Feedback");
|
cy.get('[data-cy="title"]').should("contain", "Feedback");
|
||||||
cy.get('[data-cy="evaluation-duedate]"').should("not.exist");
|
cy.get('[data-cy="evaluation-duedate]"').should("not.exist");
|
||||||
cy.get('[data-cy="instruction"]').should(
|
cy.get('[data-cy="instruction"]').should("contain", "Bitte unterstütze Test Student1 und gib Feedback zum Auftrag.");
|
||||||
"contain",
|
|
||||||
"Bitte unterstütze Test Student1 und gib Feedback zum Auftrag."
|
|
||||||
);
|
|
||||||
cy.get('[data-cy="start-evaluation"]').click();
|
cy.get('[data-cy="start-evaluation"]').click();
|
||||||
cy.get('[data-cy="evaluation-task"]').should("contain", "Feedback 1 / 5");
|
cy.get('[data-cy="evaluation-task"]').should("contain", "Feedback 1 / 5");
|
||||||
|
|
||||||
|
|
@ -239,29 +193,24 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
|
|
||||||
// load AssignmentCompletion from DB and check
|
// load AssignmentCompletion from DB and check
|
||||||
cy.loadAssignmentCompletion(
|
cy.loadAssignmentCompletion("evaluation_user_id", TEST_TRAINER1_USER_ID).then((ac) => {
|
||||||
"evaluation_user_id",
|
|
||||||
TEST_TRAINER1_USER_ID
|
|
||||||
).then((ac) => {
|
|
||||||
console.log(ac.completion_status);
|
console.log(ac.completion_status);
|
||||||
expect(ac.completion_status).to.equal("EVALUATION_IN_PROGRESS");
|
expect(ac.completion_status).to.equal("EVALUATION_IN_PROGRESS");
|
||||||
expect(JSON.stringify(ac.completion_data)).to.include("Nicht so gut");
|
expect(JSON.stringify(ac.completion_data)).to.include("Nicht so gut");
|
||||||
expect(Cypress._.values(ac.completion_data)).to.deep.include({
|
expect(Cypress._.values(ac.completion_data)).to.deep.include({
|
||||||
expert_data: { points: 0, text: "Nicht so gut" },
|
expert_data: {points: 0, text: "Nicht so gut"},
|
||||||
});
|
});
|
||||||
expect(Cypress._.values(ac.completion_data)).to.deep.include({
|
expect(Cypress._.values(ac.completion_data)).to.deep.include({
|
||||||
expert_data: { points: 0, text: "Gut gemacht!" },
|
expert_data: {points: 0, text: "Gut gemacht!"},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("can make complete evaluation", () => {
|
it("can make complete evaluation", () => {
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.get('[data-cy="dropdown-select"]').click();
|
cy.get('[data-cy="dropdown-select"]').click();
|
||||||
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
|
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
|
||||||
cy.get(
|
cy.get('[data-cy="show-details-btn-test-lehrgang-lp-circle-reisen-lc-mein-kundenstamm"]').click();
|
||||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-reisen-lc-mein-kundenstamm"]'
|
|
||||||
).click();
|
|
||||||
|
|
||||||
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
cy.get('[data-cy="Student1"]').find('[data-cy="show-results"]').click();
|
||||||
|
|
||||||
|
|
@ -303,19 +252,14 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
cy.get('[data-cy="total-points"]').should("not.exist");
|
cy.get('[data-cy="total-points"]').should("not.exist");
|
||||||
cy.get('[data-cy="submit-evaluation"]').click();
|
cy.get('[data-cy="submit-evaluation"]').click();
|
||||||
|
|
||||||
cy.get('[data-cy="result-section"]').should(
|
cy.get('[data-cy="result-section"]').should("contain", "Dein Feedback für Test Student1 wurde freigegeben");
|
||||||
"contain",
|
|
||||||
"Dein Feedback für Test Student1 wurde freigegeben"
|
|
||||||
);
|
|
||||||
|
|
||||||
// going back to cockpit should show points for student
|
// going back to cockpit should show points for student
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.reload();
|
cy.reload();
|
||||||
cy.get('[data-cy="dropdown-select"]').click();
|
cy.get('[data-cy="dropdown-select"]').click();
|
||||||
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
|
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
|
||||||
cy.get(
|
cy.get('[data-cy="show-details-btn-test-lehrgang-lp-circle-reisen-lc-mein-kundenstamm"]').click();
|
||||||
'[data-cy="show-details-btn-test-lehrgang-lp-circle-reisen-lc-mein-kundenstamm"]'
|
|
||||||
).click();
|
|
||||||
|
|
||||||
cy.get('[data-cy="Student1"]').should("contain", "Feedback freigegeben");
|
cy.get('[data-cy="Student1"]').should("contain", "Feedback freigegeben");
|
||||||
cy.get('[data-cy="Student1"]').should("not.contain", "Punkte");
|
cy.get('[data-cy="Student1"]').should("not.contain", "Punkte");
|
||||||
|
|
@ -325,10 +269,7 @@ describe("assignmentTrainer.cy.js", () => {
|
||||||
cy.url().should("include", "step=6");
|
cy.url().should("include", "step=6");
|
||||||
|
|
||||||
// load AssignmentCompletion from DB and check
|
// load AssignmentCompletion from DB and check
|
||||||
cy.loadAssignmentCompletion(
|
cy.loadAssignmentCompletion("evaluation_user_id", TEST_TRAINER1_USER_ID).then((ac) => {
|
||||||
"evaluation_user_id",
|
|
||||||
TEST_TRAINER1_USER_ID
|
|
||||||
).then((ac) => {
|
|
||||||
expect(ac.completion_status).to.equal("EVALUATION_SUBMITTED");
|
expect(ac.completion_status).to.equal("EVALUATION_SUBMITTED");
|
||||||
expect(ac.evaluation_max_points).to.equal(0);
|
expect(ac.evaluation_max_points).to.equal(0);
|
||||||
const completionString = JSON.stringify(ac.completion_data);
|
const completionString = JSON.stringify(ac.completion_data);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { login } from "../helpers";
|
import {EXPERT_COCKPIT_URL, login} from "../helpers";
|
||||||
|
|
||||||
describe("feedbackTrainer.cy.js", () => {
|
describe("feedbackTrainer.cy.js", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
@ -8,7 +8,7 @@ describe("feedbackTrainer.cy.js", () => {
|
||||||
it("can open feedback results page with empty results", () => {
|
it("can open feedback results page with empty results", () => {
|
||||||
cy.manageCommand("cypress_reset");
|
cy.manageCommand("cypress_reset");
|
||||||
login("test-trainer1@example.com", "test");
|
login("test-trainer1@example.com", "test");
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]'
|
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]'
|
||||||
).click();
|
).click();
|
||||||
|
|
@ -20,7 +20,7 @@ describe("feedbackTrainer.cy.js", () => {
|
||||||
it("can open feedback results page with results", () => {
|
it("can open feedback results page with results", () => {
|
||||||
cy.manageCommand("cypress_reset --create-feedback-responses");
|
cy.manageCommand("cypress_reset --create-feedback-responses");
|
||||||
login("test-trainer1@example.com", "test");
|
login("test-trainer1@example.com", "test");
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]'
|
'[data-cy="show-feedback-btn-test-lehrgang-lp-circle-fahrzeug-lc-feedback"]'
|
||||||
).click();
|
).click();
|
||||||
|
|
@ -138,7 +138,7 @@ describe("feedbackTrainer.cy.js", () => {
|
||||||
it("can open feedback results page with results", () => {
|
it("can open feedback results page with results", () => {
|
||||||
cy.manageCommand("cypress_reset --create-feedback-responses");
|
cy.manageCommand("cypress_reset --create-feedback-responses");
|
||||||
login("test-trainer1@example.com", "test");
|
login("test-trainer1@example.com", "test");
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.get('[data-cy="dropdown-select"]').click();
|
cy.get('[data-cy="dropdown-select"]').click();
|
||||||
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
|
cy.get('[data-cy="dropdown-select-option-Reisen"]').click();
|
||||||
cy.get(
|
cy.get(
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
|
export const EXPERT_COCKPIT_URL = "course/test-lehrgang/cockpit/expert"
|
||||||
|
|
||||||
export const login = (username, password) => {
|
export const login = (username, password) => {
|
||||||
cy.request({
|
cy.request({
|
||||||
method: "POST", url: "/api/core/login/", body: {username, password},
|
method: "POST", url: "/api/core/login/", body: {username, password},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const logout = () => {
|
export const logout = () => {
|
||||||
cy.request({
|
cy.request({
|
||||||
method: "POST", url: "/api/core/logout/",
|
method: "POST", url: "/api/core/logout/",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const BASE_URL = "/course/test-lehrgang";
|
export const BASE_URL = "/course/test-lehrgang";
|
||||||
|
|
@ -15,9 +17,9 @@ export const EXPERT_LOGIN = ["test-trainer1@example.com", "test"];
|
||||||
export const PARTICIPANT_LOGIN = ["test-student1@example.com", "test"];
|
export const PARTICIPANT_LOGIN = ["test-student1@example.com", "test"];
|
||||||
|
|
||||||
export const visitCoursePage = (subPath) => {
|
export const visitCoursePage = (subPath) => {
|
||||||
cy.visit(`${BASE_URL}/${subPath}`);
|
cy.visit(`${BASE_URL}/${subPath}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const checkNavigationLink = (dataCy, expectedLink) => {
|
export const checkNavigationLink = (dataCy, expectedLink) => {
|
||||||
cy.get(`[data-cy="${dataCy}"]`).should('have.attr', 'href').and('eq', `${BASE_URL}/${expectedLink}`);
|
cy.get(`[data-cy="${dataCy}"]`).should('have.attr', 'href').and('eq', `${BASE_URL}/${expectedLink}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { login } from "./helpers";
|
import {EXPERT_COCKPIT_URL, login} from "./helpers";
|
||||||
|
|
||||||
describe("settings.cy.js", () => {
|
describe("settings.cy.js", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
@ -14,7 +14,7 @@ describe("settings.cy.js", () => {
|
||||||
|
|
||||||
it("trainer can see circle documents", () => {
|
it("trainer can see circle documents", () => {
|
||||||
login("test-trainer1@example.com", "test");
|
login("test-trainer1@example.com", "test");
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.get('[data-cy="circle-documents"]').should("exist");
|
cy.get('[data-cy="circle-documents"]').should("exist");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -33,7 +33,7 @@ describe("settings.cy.js", () => {
|
||||||
|
|
||||||
it("trainer cannot see circle documents", () => {
|
it("trainer cannot see circle documents", () => {
|
||||||
login("test-trainer1@example.com", "test");
|
login("test-trainer1@example.com", "test");
|
||||||
cy.visit("/course/test-lehrgang/cockpit");
|
cy.visit(EXPERT_COCKPIT_URL);
|
||||||
cy.get('[data-cy="circle-documents"]').should("not.exist");
|
cy.get('[data-cy="circle-documents"]').should("not.exist");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,28 @@ class ActionTestCase(TestCase):
|
||||||
trainer_actions = course_session_permissions(trainer, self.course_session.id)
|
trainer_actions = course_session_permissions(trainer, self.course_session.id)
|
||||||
|
|
||||||
# THEN
|
# THEN
|
||||||
self.assertEqual(len(mentor_actions), 0)
|
self.assertEqual(
|
||||||
self.assertEqual(participant_actions, ["complete-learning-content"])
|
mentor_actions,
|
||||||
self.assertEqual(trainer_actions, ["complete-learning-content"])
|
["learning-mentor", "preview", "appointments", "expert-cockpit"],
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
participant_actions,
|
||||||
|
[
|
||||||
|
"deprecated-mentor",
|
||||||
|
"media-library",
|
||||||
|
"appointments",
|
||||||
|
"learning-path",
|
||||||
|
"competence-navi",
|
||||||
|
"complete-learning-content",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
trainer_actions,
|
||||||
|
[
|
||||||
|
"preview",
|
||||||
|
"media-library",
|
||||||
|
"appointments",
|
||||||
|
"expert-cockpit",
|
||||||
|
"complete-learning-content",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue