import { chromium } from 'playwright'
const b = await chromium.launch()
const ctx = await b.newContext({ viewport: { width: 1400, height: 900 } })
const p = await ctx.newPage()
await p.goto('http://localhost:8080/')
await p.fill('input[placeholder="请输入账号"]', 'admin')
await p.fill('input[placeholder="请输入密码"]', '123456')
await p.click('button.login-btn')
await p.waitForTimeout(1500)
await p.goto('http://localhost:8080/#/customization/hsbc/channel')
await p.waitForTimeout(1500)
await p.click('button:has-text("新建 Channel")')
await p.waitForTimeout(800)
const w = await p.evaluate(() => getComputedStyle(document.querySelector('.el-dialog .inline-field .el-select')).width)
console.log('SELECT_WIDTH:', w)
await p.screenshot({ path: 'scripts/shot-channel-dialog.png' })
await b.close()
