mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 18:20:24 -05:00
31 lines
672 B
JavaScript
31 lines
672 B
JavaScript
import { MobileAccountPage } from './mobile-account-page';
|
|
|
|
export class MobileAccountsPage {
|
|
constructor(page) {
|
|
this.page = page;
|
|
|
|
this.accounts = this.page.getByTestId('account');
|
|
}
|
|
|
|
/**
|
|
* Get the name and balance of the nth account
|
|
*/
|
|
async getNthAccount(idx) {
|
|
const accountRow = this.accounts.nth(idx);
|
|
|
|
return {
|
|
name: accountRow.getByTestId('account-name'),
|
|
balance: accountRow.getByTestId('account-balance'),
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Click on the n-th account to open it up
|
|
*/
|
|
async openNthAccount(idx) {
|
|
await this.accounts.nth(idx).getByRole('button').click();
|
|
|
|
return new MobileAccountPage(this.page);
|
|
}
|
|
}
|