Skip to content

Commit

Permalink
Development: Fix exam results overview e2e test (#9472)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonEntholzer authored Oct 13, 2024
1 parent ca16367 commit 6549075
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/exam/ExamResults.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test.describe('Exam Results', () => {
}
exercise = await examExerciseGroupCreation.addGroupWithExercise(exam, testCase.exerciseType, additionalData);
await examAPIRequests.registerStudentForExam(exam, studentOne);
const studentExams = await examAPIRequests.generateMissingIndividualExams(exam);
const studentExams = await examAPIRequests.getAllStudentExams(exam);
studentExam = studentExams[0];
await examAPIRequests.prepareExerciseStartForExam(exam);
});
Expand Down
9 changes: 9 additions & 0 deletions src/test/playwright/support/requests/ExamAPIRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ export class ExamAPIRequests {
return await response.json();
}

/**
* Get all student-exams of an exam
* @param exam the exam for which the student-exams are fetched
*/
async getAllStudentExams(exam: Exam) {
const response = await this.page.request.get(`${COURSE_BASE}/${exam.course!.id}/exams/${exam.id}/student-exams`);
return await response.json();
}

/**
* Prepares individual exercises for exam start
* @param exam the exam for which the exercises are prepared
Expand Down

0 comments on commit 6549075

Please sign in to comment.