tiny-vue/examples/sites/demos/pc/app/grid/expand/expand-config.spec.js

32 lines
1.3 KiB
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('基本用法', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('grid-expand#expand-expand-config')
// 默认展开行
await expect(page.locator('#expand-expand-config tbody span').filter({ hasText: '800' })).toBeVisible()
// 点击展开
await page
.getByRole('row', {
name: '公司名称GFD科技YX公司 区域:华东区 员工数800 公司简介公司技术和研发实力雄厚是国家863项目的参与者并被政府认定为“高新技术企业”。'
})
.getByText('公司技术和研发实力雄厚是国家863项目的参与者并被政府认定为“高新技术企业”。')
.click()
await page.getByText('区域:华南区').click()
await page.getByRole('row', { name: '3 TGBYX公司 华南区 360' }).locator('i').click()
await page.getByRole('row', { name: '2 WWWW科技YX公司 华南区 500' }).locator('i').click()
await expect(page.getByText('员工数500')).toBeVisible()
// 验证展开图标隐藏
const cell = page
.getByRole('row', { name: '4 康康物业YX公司 华南区 400' })
.getByRole('cell')
.nth(1)
.locator('.tiny-grid__expand-icon')
await expect(cell).toHaveCount(0)
})