Files
actual/packages/desktop-client/e2e/page-models/mobile-account-page.js
Joel Jeremy Marquez 2d188b3941 [Mobile] Category activity/transactions page (#2531)
* Mobile category transactions

* Release notes

* Fix typo

* Fix typecheck error

* Handle null location state

* VRT

* Fix account search

* Update test

* Search placeholder

* vrt

* Add month to page title

* Cleanup

* Fix AccountName component

* Replace ButtonLink with Link

* Fix typecheck

* Code review update
2024-04-13 11:45:43 -07:00

40 lines
1.1 KiB
JavaScript

import { MobileTransactionEntryPage } from './mobile-transaction-entry-page';
export class MobileAccountPage {
constructor(page) {
this.page = page;
this.heading = page.getByRole('heading');
this.balance = page.getByTestId('transactions-balance');
this.noTransactionsFoundError = page.getByText('No transactions');
this.searchBox = page.getByPlaceholder(/^Search/);
this.transactionList = page.getByLabel('transaction list');
this.transactions = this.transactionList.getByRole('button');
this.createTransactionButton = page.getByRole('button', {
name: 'Add Transaction',
});
}
/**
* Retrieve the balance of the account as a number
*/
async getBalance() {
return parseInt(await this.balance.textContent(), 10);
}
/**
* Search by the given term
*/
async searchByText(term) {
await this.searchBox.fill(term);
}
/**
* Go to transaction creation page
*/
async clickCreateTransaction() {
this.createTransactionButton.click();
return new MobileTransactionEntryPage(this.page);
}
}