shot-quill3.mjs 788 B

12345678910111213141516171819
  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/equity-products/add')
  11. await p.waitForTimeout(2000)
  12. // scroll quill into view inside content scroller
  13. await p.evaluate(() => {
  14. const tb = document.querySelector('.ql-toolbar')
  15. tb?.scrollIntoView({ block: 'center' })
  16. })
  17. await p.waitForTimeout(500)
  18. await p.screenshot({ path: 'scripts/shot-quill-final.png' })
  19. await b.close()