Files
actual/packages/desktop-client/e2e/page-models/mobile-transaction-entry-page.js
2023-08-20 20:19:15 +01:00

24 lines
631 B
JavaScript

import { MobileAccountPage } from './mobile-account-page';
export class MobileTransactionEntryPage {
constructor(page) {
this.page = page;
this.header = page.getByRole('heading');
this.amountField = page.getByTestId('amount-input');
this.add = page.getByRole('button', { name: 'Add transaction' });
}
async fillField(fieldLocator, content) {
await fieldLocator.click();
await this.page.locator('css=[role=combobox] input').fill(content);
await this.page.keyboard.press('Enter');
}
async createTransaction() {
await this.add.click();
return new MobileAccountPage(this.page);
}
}