tiny-vue/examples/sites/demos/pc/app/rate/dynamic-disable.spec.js

18 lines
730 B
JavaScript
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.describe('Rate 禁用', () => {
test('icon禁用', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('rate#dynamic-disable')
const icon = page.locator('.tiny-rate__star')
// 测试每个人icon是否禁用半选icon应选择第一个icon
await expect(icon.nth(0).locator('svg')).toHaveClass(/disabled/)
await expect(icon.nth(1).locator('svg')).toHaveClass(/disabled/)
await expect(icon.nth(2).locator('svg').first()).toHaveClass(/disabled/)
await expect(icon.nth(3).locator('svg')).toHaveClass(/disabled/)
await expect(icon.nth(4).locator('svg')).toHaveClass(/disabled/)
})
})