tiny-vue_version0/examples/sites/demos/pc/app/switch/event-change.spec.ts

16 lines
517 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('switch#event-change')
const demo = page.locator('#event-change')
const switchBtn = demo.locator('.tiny-switch')
const modal = page.locator('.tiny-modal')
await switchBtn.click()
await expect(modal.getByText('true')).toBeVisible()
await switchBtn.click()
await expect(modal.getByText('开关值false')).toBeVisible()
})