-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Development: Adds playwright e2e quiz exercise tests for different ba…
…tch modes (#8645)
- Loading branch information
Showing
13 changed files
with
287 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/test/playwright/support/pageobjects/exercises/quiz/QuizExerciseOverviewPage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Page } from '@playwright/test'; | ||
import { BASE_API } from '../../../constants'; | ||
import { QuizBatch } from 'app/entities/quiz/quiz-exercise.model'; | ||
|
||
export class QuizExerciseOverviewPage { | ||
private readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
} | ||
|
||
/** | ||
* Adds a quiz batch to the quiz exercise with the given ID. | ||
* @param exerciseId The ID of the quiz exercise to add a batch to. | ||
* @returns The created quiz batch. | ||
*/ | ||
async addQuizBatch(exerciseId: number): Promise<QuizBatch> { | ||
const responsePromise = this.page.waitForResponse(`${BASE_API}/quiz-exercises/${exerciseId}/add-batch`); | ||
await this.page.locator(`#instructor-quiz-add-${exerciseId}`).click(); | ||
const response = await responsePromise; | ||
return await response.json(); | ||
} | ||
|
||
/** | ||
* Starts the quiz batch with the given batch ID for the given exercise. | ||
* @param exerciseId The ID of the quiz exercise the batch belongs to. | ||
* @param batchId The ID of the batch to start. | ||
*/ | ||
async startQuizBatch(exerciseId: number, batchId: number) { | ||
await this.page.locator(`#instructor-quiz-start-${exerciseId}-${batchId}`).click(); | ||
} | ||
} |
Oops, something went wrong.