Skip to content

Instantly share code, notes, and snippets.

@zaydek
Created February 5, 2020 19:51
Show Gist options
  • Save zaydek/d0f184cbebed0a17912a4843a361f71b to your computer and use it in GitHub Desktop.
Save zaydek/d0f184cbebed0a17912a4843a361f71b to your computer and use it in GitHub Desktop.
FAIL src/components/Editor/__tests/playwright.test.js (8.955s)
✕ (7056ms)
Evaluation failed: {}
12 | await page.focus("[contenteditable]")
13 | // https://github.com/puppeteer/puppeteer/issues/1313
> 14 | await page.evaluate(() => document.execCommand("selectall", false, null))
| ^
15 | await page.keyboard.press("Backspace")
16 | await page.keyboard.type("Hello, world! 😀", { delay: 50 })
17 | await browser.close()
at checkException (node_modules/playwright-core/lib/firefox/ffExecutionContext.js:155:19)
at FFExecutionContext.evaluate (node_modules/playwright-core/lib/firefox/ffExecutionContext.js:92:9)
at Object.<anonymous> (src/components/Editor/__tests/playwright.test.js:14:3)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 9.589s
Ran all test suites matching /playwright.test.js/i.
import { chromium, firefox, webkit } from "playwright"
;(function () {
jest.setTimeout(60e3)
})()
test("", async () => {
for (const browserType of [chromium, firefox, webkit]) {
const browser = await browserType.launch({ headless: false })
const context = await browser.newContext()
const page = await context.newPage("http://localhost:3000")
await page.focus("[contenteditable]")
// https://github.com/puppeteer/puppeteer/issues/1313
await page.evaluate(() => document.execCommand("selectall", false, null))
await page.keyboard.press("Backspace")
await page.keyboard.type("Hello, world! 😀", { delay: 50 })
await browser.close()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment