mirror of
https://github.com/jcreek/AutomatedAssessmentFeedbackAgent.git
synced 2026-07-12 18:43:49 +00:00
test(*): Add POM to BDD tests
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
export class UploadPage {
|
||||
readonly page: Page;
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
taskInputSelector = '[data-testid="task-input"]';
|
||||
fileInputSelector = 'input[type="file"]';
|
||||
submissionInputSelector = '[data-testid="submission-input"]';
|
||||
submitButtonSelector = '[data-testid="submit-button"]';
|
||||
|
||||
async navigateTo() {
|
||||
await this.page.goto('http://localhost:5173/upload');
|
||||
}
|
||||
|
||||
async setTaskDescription(text: string) {
|
||||
await this.page.fill(this.taskInputSelector, text);
|
||||
}
|
||||
|
||||
async uploadFile(filePath: string) {
|
||||
await this.page.setInputFiles(this.fileInputSelector, filePath);
|
||||
}
|
||||
|
||||
async setSubmissionText(text: string) {
|
||||
await this.page.fill(this.submissionInputSelector, text);
|
||||
}
|
||||
|
||||
async submit() {
|
||||
await this.page.click(this.submitButtonSelector);
|
||||
}
|
||||
|
||||
async isSubmitButtonEnabled() {
|
||||
return this.page.isEnabled(this.submitButtonSelector);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user