Browse Source

Fixing the pick-and-clik test

pull/1047/head
miguel 8 months ago
parent
commit
a08836e68f
  1. 13
      dom/pick-and-click_test.js

13
dom/pick-and-click_test.js

@ -76,14 +76,13 @@ tests.push(async ({ page, eq, bodyBgRgb, random }) => {
tests.push(async ({ page, eq, bodyBgRgb, random }) => {
// check that the hsl value is copied in the clipboard on click
// Override readText if writeText is used due to a puppeteer bug
await page.evaluate(() => {
window.navigator.clipboard.writeText = async (text) => {
window.navigator.clipboard.readText = async () => text
}
})
for (const move of generateCoords(random)) {
await page.evaluate(() => {
let clipboardText = null
window.navigator.clipboard.readText = async () => clipboardText
window.navigator.clipboard.writeText = async (text) => {
clipboardText = text
}
})
await page.mouse.click(...move)
const clipboard = await page.evaluate(() =>
window.navigator.clipboard.readText()

Loading…
Cancel
Save