tiny-vue_version0/examples/sites/demos/pc/app/radio/radio-events.spec.ts

16 lines
690 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test, expect } from '@playwright/test'
test('单选框事件', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('radio#radio-events')
const demo = page.locator('#radio-events')
await demo.getByRole('radio', { name: '选项二' }).click()
const radio1 = page.locator('div').filter({ hasText: 'change 事件,选中的 Radio label 值为2' }).nth(1)
await expect(radio1).toBeVisible()
await demo.getByRole('radio', { name: '月度' }).first().click()
const radio2 = page.locator('div').filter({ hasText: 'change 事件,选中的 Radio label 值为2' }).nth(1)
await expect(radio2).toBeVisible()
})