Files
TokenizeRWATemplate/projects/TokenizeRWATemplate-frontend/tests/example.spec.ts
Raghav d62f2fd1ca
Some checks failed
Release / Run TokenizeRWATemplate-contracts release (push) Has been cancelled
Release / Run TokenizeRWATemplate-frontend release (push) Has been cancelled
Update project templates and workspace configuration files
Co-Authored-By: Oz <oz-agent@warp.dev>
2026-04-16 10:38:17 +05:30

41 lines
1.4 KiB
TypeScript
Executable File

import { algorandFixture } from '@algorandfoundation/algokit-utils/testing'
import { expect, test } from '@playwright/test'
const localnet = algorandFixture()
test.beforeEach(async ({ page }) => {
await localnet.newScope()
await page.goto('http://localhost:5173/')
})
test('has title', async ({ page }) => {
// Expect a title "to contain" a substring.
await expect(page).toHaveTitle('AlgoKit React Template')
})
test('get started link', async ({ page }) => {
await expect(page.getByTestId('getting-started')).toHaveText('Getting started')
})
test('authentication and dummy payment transaction', async ({ page }) => {
page.on('dialog', async (dialog) => {
dialog.message() === 'KMD password' ? await dialog.accept() : await dialog.dismiss()
})
// 1. Must be able to connect to a KMD wallet provider
await page.getByTestId('connect-wallet').click()
await page.getByTestId('kmd-connect').click()
await page.getByTestId('close-wallet-modal').click()
// 2. Must be able to send a dummy payment transaction
await page.getByTestId('transactions-demo').click()
await page.getByTestId('receiver-address').fill(localnet.context.testAccount.toString())
await page.getByTestId('send-algo').click()
// 3. Must be able to see a notification that the transaction was sent
const notification = await page.getByText('Transaction sent:')
await notification.waitFor()
expect(notification).toBeTruthy()
})