feat(需求): ①全站分页pageSize统一默认10+10/20/50/100选项(9页默认值15/20→10+6个兜底常量统一+撞款台账升级OldPagination+商品类目树顶层标准分页) ②修复6页OldPagination缺import分页器不渲染(不符合ASIN/查询ASIN/最低价ASIN/生成记录/店铺密钥/店铺管理)+查询ASIN操作列按钮间距+最低价范围筛选number类型报错 ③e2e断言对齐现状(顶栏h1/移除收起按钮后规格同步)+国家显示中文断言固化
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { chromium } from '@playwright/test'
|
||||
const browser = await chromium.launch({ channel: 'msedge', headless: true })
|
||||
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } })
|
||||
const errors = []
|
||||
page.on('pageerror', (e) => errors.push('pageerror: ' + e.message))
|
||||
page.on('console', (m) => { if (m.type() === 'error') errors.push('console: ' + m.text().slice(0, 200)) })
|
||||
const userReqs = []
|
||||
page.on('request', (r) => { if (r.url().includes('/api/admin/users')) userReqs.push(r.url()) })
|
||||
await page.goto('http://localhost:5174/admin-vue/', { waitUntil: 'networkidle' })
|
||||
await page.waitForTimeout(800)
|
||||
if (await page.locator('#loginUsername').isVisible().catch(() => false)) {
|
||||
await page.locator('#loginUsername').fill('admin')
|
||||
await page.locator('#loginPassword').fill('admin123')
|
||||
await page.locator('.btn-login').click()
|
||||
await page.waitForSelector('.admin-shell', { timeout: 25000 }).catch(() => {})
|
||||
await page.waitForTimeout(1500)
|
||||
}
|
||||
await page.goto('http://localhost:5174/admin-vue/account/users', { waitUntil: 'domcontentloaded' })
|
||||
await page.waitForTimeout(2200)
|
||||
const selects = page.locator('.users-filter-row .el-select')
|
||||
console.log('筛选行 el-select 数量:', await selects.count())
|
||||
await selects.nth(1).click()
|
||||
await page.waitForTimeout(700)
|
||||
const items = page.locator('.el-select-dropdown__item:visible')
|
||||
console.log('选项:', JSON.stringify(await items.allTextContents()))
|
||||
await items.filter({ hasText: /^管理员$/ }).first().click()
|
||||
await page.waitForTimeout(1200)
|
||||
console.log('change 后请求:', JSON.stringify(userReqs.slice(-1)))
|
||||
await page.locator('.users-filter-row button.btn').first().click()
|
||||
await page.waitForTimeout(2500)
|
||||
console.log('点查询后请求:', JSON.stringify(userReqs.slice(-1)))
|
||||
console.log('选中显示:', (await selects.nth(1).textContent())?.trim())
|
||||
console.log('最近 users 请求:', JSON.stringify(userReqs.slice(-2)))
|
||||
const roles = await page.locator('.table-scroll tbody tr td').nth(2).textContent().catch(() => '?')
|
||||
console.log('第一行角色:', roles?.trim())
|
||||
await page.goto('http://localhost:5174/admin-vue/asin-center/skip-price', { waitUntil: 'domcontentloaded' })
|
||||
await page.waitForTimeout(2000)
|
||||
await page.locator('.price-range-row input').first().fill('1.15')
|
||||
await page.locator('.skip-filter-row button.btn').first().click()
|
||||
await page.waitForTimeout(2500)
|
||||
console.log('errors:', JSON.stringify(errors))
|
||||
await browser.close()
|
||||
Reference in New Issue
Block a user