cycles-quartz/examples/transfers/frontend/tests/e2e/helpers/connectWalet.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

22 lines
549 B
TypeScript

import { BrowserContext, Page } from '@playwright/test'
import { routes } from '@/config/routes'
export const connectWallet = async ({
context,
page,
}: {
context: BrowserContext
page: Page
}) => {
// Connect to Keplr wallet
await page.goto(routes.landing)
await page.getByRole('button', { name: /connect/i }).click()
// Accept app suggested testnet info
const addChainPage = await context.waitForEvent('page')
await addChainPage.getByRole('button', { name: /approve/i }).click()
await addChainPage.waitForEvent('close')
}