Auto-approve E2E test (#299)

This commit is contained in:
Will Chen
2025-05-31 23:50:09 -07:00
committed by GitHub
parent 54af09a041
commit 5c8cd05cf6
4 changed files with 42 additions and 1 deletions

View File

@@ -8,10 +8,14 @@ const showDebugLogs = process.env.DEBUG_LOGS === "true";
class PageObject {
constructor(private page: Page) {}
async setUp() {
async setUp({ autoApprove = false }: { autoApprove?: boolean } = {}) {
await this.goToSettingsTab();
if (autoApprove) {
await this.toggleAutoApprove();
}
await this.setUpTestProvider();
await this.setUpTestModel();
await this.goToAppsTab();
await this.selectTestModel();
}
@@ -142,6 +146,14 @@ class PageObject {
await this.page.getByRole("link", { name: "Settings" }).click();
}
////////////////////////////////
// Settings related
////////////////////////////////
async toggleAutoApprove() {
await this.page.getByRole("switch", { name: "Auto-approve" }).click();
}
async goToAppsTab() {
await this.page.getByRole("link", { name: "Apps" }).click();
}