diff --git a/src/test/cypress/e2e/course/CourseExercise.cy.ts b/src/test/cypress/e2e/course/CourseExercise.cy.ts index b49cf4a61c9f..f0f7bac0df38 100644 --- a/src/test/cypress/e2e/course/CourseExercise.cy.ts +++ b/src/test/cypress/e2e/course/CourseExercise.cy.ts @@ -35,13 +35,13 @@ describe('Course Exercise', () => { it('should filter exercises based on title', () => { cy.visit(`/courses/${course.id}/exercises`); - courseOverview.getExercise(exercise1.id!).should('be.visible'); - courseOverview.getExercise(exercise2.id!).should('be.visible'); - courseOverview.getExercise(exercise3.id!).should('be.visible'); + courseOverview.getExercise(exercise1.title!).should('be.visible'); + courseOverview.getExercise(exercise2.title!).should('be.visible'); + courseOverview.getExercise(exercise3.title!).should('be.visible'); courseOverview.search('Course Exercise Quiz'); - courseOverview.getExercise(exercise1.id!).should('be.visible'); - courseOverview.getExercise(exercise2.id!).should('be.visible'); - courseOverview.getExercise(exercise3.id!).should('not.exist'); + courseOverview.getExercise(exercise1.title!).should('be.visible'); + courseOverview.getExercise(exercise2.title!).should('be.visible'); + courseOverview.getExercise(exercise3.title!).should('not.exist'); }); after('Delete Exercises', () => { diff --git a/src/test/cypress/e2e/exercises/ExerciseImport.cy.ts b/src/test/cypress/e2e/exercises/ExerciseImport.cy.ts index de1120362720..fdd486124a9d 100644 --- a/src/test/cypress/e2e/exercises/ExerciseImport.cy.ts +++ b/src/test/cypress/e2e/exercises/ExerciseImport.cy.ts @@ -79,6 +79,7 @@ describe('Import exercises', { scrollBehavior: 'center' }, () => { textExerciseCreation.import().then((request: Interception) => { const exercise = request.response!.body; cy.login(studentOne, `/courses/${secondCourse.id}`); + courseOverview.openExerciseOverview(exercise.title!); courseOverview.startExercise(exercise.id!); courseOverview.openRunningExercise(exercise.id!); cy.fixture('loremIpsum-short.txt').then((submission) => { @@ -112,6 +113,7 @@ describe('Import exercises', { scrollBehavior: 'center' }, () => { const exercise = request.response!.body; courseManagementExercises.startQuiz(exercise.id!); cy.login(studentOne, `/courses/${secondCourse.id}`); + courseOverview.openExerciseOverview(exercise.title!); courseOverview.startExercise(exercise.id!); quizExerciseMultipleChoice.tickAnswerOption(exercise.id!, 0); quizExerciseMultipleChoice.tickAnswerOption(exercise.id!, 2); @@ -137,6 +139,7 @@ describe('Import exercises', { scrollBehavior: 'center' }, () => { modelingExerciseCreation.import().then((request: Interception) => { const exercise = request.response!.body; cy.login(studentOne, `/courses/${secondCourse.id}`); + courseOverview.openExerciseOverview(exercise.title!); courseOverview.startExercise(exercise.id!); courseOverview.openRunningExercise(exercise.id!); modelingExerciseEditor.addComponentToModel(exercise.id!, 1); @@ -163,6 +166,7 @@ describe('Import exercises', { scrollBehavior: 'center' }, () => { programmingExerciseCreation.import().then((request: Interception) => { const exercise = request.response!.body; cy.login(studentOne, `/courses/${secondCourse.id}`); + courseOverview.openExerciseOverview(exercise.title!); courseOverview.startExercise(exercise.id!); courseOverview.openRunningExercise(exercise.id!); programmingExerciseEditor.makeSubmissionAndVerifyResults(exercise.id!, javaPartiallySuccessfulSubmission, () => { diff --git a/src/test/cypress/e2e/exercises/modeling/ModelingExerciseManagement.cy.ts b/src/test/cypress/e2e/exercises/modeling/ModelingExerciseManagement.cy.ts index d98465b07445..06c835a525d7 100644 --- a/src/test/cypress/e2e/exercises/modeling/ModelingExerciseManagement.cy.ts +++ b/src/test/cypress/e2e/exercises/modeling/ModelingExerciseManagement.cy.ts @@ -8,6 +8,7 @@ import { courseManagement, courseManagementAPIRequest, courseManagementExercises, + courseOverview, exerciseAPIRequest, modelingExerciseAssessment, modelingExerciseCreation, @@ -135,7 +136,7 @@ describe('Modeling Exercise Management', () => { }); cy.login(studentOne, '/courses'); cy.contains(course.title!).click({ force: true }); - cy.contains('No exercises available for the course.').should('be.visible'); + courseOverview.getExercises().should('have.length', 0); }); it('Student can see released Modeling Exercise', () => { diff --git a/src/test/cypress/e2e/exercises/quiz-exercise/QuizExerciseParticipation.cy.ts b/src/test/cypress/e2e/exercises/quiz-exercise/QuizExerciseParticipation.cy.ts index 391cf81bb551..534b9af18f8a 100644 --- a/src/test/cypress/e2e/exercises/quiz-exercise/QuizExerciseParticipation.cy.ts +++ b/src/test/cypress/e2e/exercises/quiz-exercise/QuizExerciseParticipation.cy.ts @@ -28,7 +28,7 @@ describe('Quiz Exercise Participation', () => { it('Student cannot see hidden quiz', () => { cy.login(studentOne, '/courses/' + course.id); - cy.contains('No exercises available for the course.').should('be.visible'); + courseOverview.getExercises().should('have.length', 0); }); it('Student can see a visible quiz', () => { diff --git a/src/test/cypress/support/pageobjects/course/CourseCommunication.ts b/src/test/cypress/support/pageobjects/course/CourseCommunication.ts index aad99ea51744..8141e31dfa0f 100644 --- a/src/test/cypress/support/pageobjects/course/CourseCommunication.ts +++ b/src/test/cypress/support/pageobjects/course/CourseCommunication.ts @@ -36,7 +36,7 @@ export class CourseCommunicationPage { } searchForMessage(search: string) { - cy.get('#search').type(search); + cy.get('input[name="searchText"]').type(search); cy.get('#search-submit').click(); } diff --git a/src/test/cypress/support/pageobjects/course/CourseOverviewPage.ts b/src/test/cypress/support/pageobjects/course/CourseOverviewPage.ts index 1c05a4eccd20..045eeb817d56 100644 --- a/src/test/cypress/support/pageobjects/course/CourseOverviewPage.ts +++ b/src/test/cypress/support/pageobjects/course/CourseOverviewPage.ts @@ -7,8 +7,7 @@ export class CourseOverviewPage { readonly participationRequestId = 'participateInExerciseQuery'; search(term: string): void { - cy.get('#exercise-search-input').type(term); - cy.get('#exercise-search-button').click(); + cy.get('input[formcontrolname="searchFilter"]').type(term); } startExercise(exerciseId: number) { @@ -21,8 +20,16 @@ export class CourseOverviewPage { cy.get('#open-exercise-' + exerciseId).click(); } - getExercise(exerciseID: number) { - return cy.get(`#exercise-card-${exerciseID}`); + getExercise(exerciseTitle: string) { + return cy.contains('#test-sidebar-card', exerciseTitle); + } + + openExerciseOverview(exerciseTitle: string) { + this.getExercise(exerciseTitle).click(); + } + + getExercises() { + return cy.get('#test-sidebar-card'); } openRunningProgrammingExercise(exerciseID: number) { diff --git a/src/test/cypress/support/pageobjects/exercises/ExerciseResultPage.ts b/src/test/cypress/support/pageobjects/exercises/ExerciseResultPage.ts index 0969590991cc..3a81f5a1796b 100644 --- a/src/test/cypress/support/pageobjects/exercises/ExerciseResultPage.ts +++ b/src/test/cypress/support/pageobjects/exercises/ExerciseResultPage.ts @@ -14,7 +14,7 @@ export class ExerciseResultPage { shouldShowScore(percentage: number) { cy.reloadUntilFound('#submission-result-graded'); - cy.contains(`${percentage}%`).should('be.visible'); + cy.contains('.tab-bar-exercise-details', `${percentage}%`).should('be.visible'); } clickOpenExercise(exerciseId: number) {