tiny-vue/examples/sites/demos/pc/app/slider/show-tip.spec.ts

15 lines
514 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('slider#show-tip')
const slider = page.locator('.tiny-slider-container .tiny-slider')
const sliderDiv = slider.locator('.tiny-slider__handle')
const sliderText = slider.locator('.tiny-slider__tips')
// 悬浮至滑块
await sliderDiv.hover()
// 弹出框显示提示
await expect(sliderText).toHaveText('当前值为20')
})