shot-channel.mjs 811 B

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