cycles-quartz/examples/transfers/frontend/tests/e2e/helpers/getBalance.ts
Daniel Gushchyan 14a6913632
refactor: refactor repo as standard rust monorepo (#222)
Co-authored-by: hu55a1n1 <sufialhussaini@gmail.com>
2024-09-30 23:33:22 +04:00

21 lines
492 B
TypeScript

import { BrowserContext, Page } from '@playwright/test'
import { signTx } from './signTx'
export const getBalance = async ({
context,
page,
}: {
context: BrowserContext
page: Page
}) => {
// Check new balance
await page.getByRole('button', { name: /get/i }).click()
await signTx({ context, page })
// Wait for the success alert to appear so we know balance updated
await page.getByText(/\$/i).waitFor({ state: 'visible' })
return page.getByText(/\$/i).textContent()
}