mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-22 00:13:45 -05:00
* Dummy commit * Delete js snapshots * Move extended expect and test to fixtures * Fix wrong commit * Update VRT * Dummy commit to run GH actions * Convert test page models to TS * Release notes * Fix typecheck errors * New page models to TS * Fix typecheck error * Fix page name * Put awaits on getTableTotals --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { type Locator, type Page } from '@playwright/test';
|
|
|
|
import { CustomReportPage } from './custom-report-page';
|
|
|
|
export class ReportsPage {
|
|
readonly page: Page;
|
|
readonly pageContent: Locator;
|
|
|
|
constructor(page: Page) {
|
|
this.page = page;
|
|
this.pageContent = page.getByTestId('reports-page');
|
|
}
|
|
|
|
async waitToLoad() {
|
|
return this.pageContent.getByRole('button', { name: /^Net/ }).waitFor();
|
|
}
|
|
|
|
async goToNetWorthPage() {
|
|
await this.pageContent.getByRole('button', { name: /^Net/ }).click();
|
|
return new ReportsPage(this.page);
|
|
}
|
|
|
|
async goToCashFlowPage() {
|
|
await this.pageContent.getByRole('button', { name: /^Cash/ }).click();
|
|
return new ReportsPage(this.page);
|
|
}
|
|
|
|
async goToCustomReportPage() {
|
|
await this.pageContent
|
|
.getByRole('button', { name: 'Add new widget' })
|
|
.click();
|
|
await this.page.getByRole('button', { name: 'New custom report' }).click();
|
|
return new CustomReportPage(this.page);
|
|
}
|
|
|
|
async getAvailableReportList() {
|
|
return this.pageContent
|
|
.getByRole('button')
|
|
.getByRole('heading')
|
|
.allTextContents();
|
|
}
|
|
}
|