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