tiny-vue/examples/sites/demos/pc/app/checkbox/checkbox-events.spec.ts

15 lines
590 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('checkbox#checkbox-events')
const demo = page.locator('#checkbox-events')
const checkbox = demo.locator('.tiny-checkbox-group > label')
await checkbox.nth(1).click()
await expect(page.getByText('change 事件触发了选中值为复选框1,复选框2')).toBeVisible()
await checkbox.nth(0).click()
await expect(page.getByText('change 事件触发了选中值为复选框2')).toBeVisible()
})