cycles-quartz/examples/transfers/frontend/tests/e2e/helpers/getBalance.ts
dusterbloom 864da77405
devX: Docker compose for neutron + quartz cli (#248)
Co-authored-by: Juan Enrique Alcaraz <juanenrisley@gmail.com>
2024-10-10 14:41:16 +02:00

25 lines
556 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,
notificationMsg: 'Balance updated successfully',
})
// Wait for the success alert to appear so we know balance updated
await page.getByText(/\$/i).waitFor({ state: 'visible' })
return page.getByText(/\$/i).textContent()
}