Files
actual/packages/desktop-client/e2e/page-models/mobile-accounts-page.js
Matiss Janis Aboltins a0290609f9 👷 visual regression tests (#1553)
2023-08-25 17:34:10 +01:00

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);
}
}