Files
actual/packages/desktop-client/e2e/page-models/mobile-budget-menu-modal.ts
erwannc 0793eb5927 Add Notes to Monthly Budget Cell (#6620)
* Add Notes to Monthly Budget Cell
Changed Modal menus layout to follow month menu on mobile

* Fixed rebase errors

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6620

* Addressed youngcw's comments (notes id format, notesButton defaultColor and modal layout)

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6620

* Updated mobile budget menu modal page model

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: youngcw <calebyoung94@gmail.com>
2026-03-19 00:42:30 +00:00

80 lines
2.2 KiB
TypeScript

import type { Locator, Page } from '@playwright/test';
export class BudgetMenuModal {
readonly page: Page;
readonly locator: Locator;
readonly heading: Locator;
readonly budgetAmountInput: Locator;
readonly actionsButton: Locator;
readonly copyLastMonthBudgetButton: Locator;
readonly setTo3MonthAverageButton: Locator;
readonly setTo6MonthAverageButton: Locator;
readonly setToYearlyAverageButton: Locator;
readonly applyBudgetTemplateButton: Locator;
constructor(locator: Locator) {
this.locator = locator;
this.page = locator.page();
this.heading = locator.getByRole('heading');
this.budgetAmountInput = locator.getByTestId('amount-input');
this.actionsButton = locator.getByRole('button', {
name: 'Actions',
});
this.copyLastMonthBudgetButton = locator.getByRole('button', {
name: "Copy last month's budget",
});
this.setTo3MonthAverageButton = locator.getByRole('button', {
name: 'Set to 3 month average',
});
this.setTo6MonthAverageButton = locator.getByRole('button', {
name: 'Set to 6 month average',
});
this.setToYearlyAverageButton = locator.getByRole('button', {
name: 'Set to yearly average',
});
this.applyBudgetTemplateButton = locator.getByRole('button', {
name: 'Overwrite with template',
});
}
async close() {
await this.heading.getByRole('button', { name: 'Close' }).click();
}
async showActions() {
await this.actionsButton.click();
}
async setBudgetAmount(newAmount: string) {
await this.budgetAmountInput.fill(newAmount);
await this.budgetAmountInput.blur();
await this.close();
}
async copyLastMonthBudget() {
await this.showActions();
await this.copyLastMonthBudgetButton.click();
}
async setTo3MonthAverage() {
await this.showActions();
await this.setTo3MonthAverageButton.click();
}
async setTo6MonthAverage() {
await this.showActions();
await this.setTo6MonthAverageButton.click();
}
async setToYearlyAverage() {
await this.showActions();
await this.setToYearlyAverageButton.click();
}
async applyBudgetTemplate() {
await this.showActions();
await this.applyBudgetTemplateButton.click();
}
}