I'm trying to write a simple e2e test.
import {chromium, webkit, firefox} from "playwright";
(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();
await page.goto("https://github.com");
await page.fill('input[aria-label="Search GitHub"]', "Playwright");
await page.press('input[aria-label="Search GitHub"]', "Enter");
await page.click(".repo-list-item:nth-child(1) a");
await page.click('span[data-content="Security"]');
await page.screenshot({path: `screenshots/security-${browserType.name()}.png`, fullPage: false});
await page.close();
await browser.close();
}
})();
This code is working fine with chromium and firefox. However, when I use webkit it breaks on the second screen. Webkit error logs:
Error.captureStackTrace(stackObject);
^
page.click: Protocol error (Runtime.awaitPromise): The page has been closed.
=========================== logs ===========================
waiting for selector ".repo-list-item:nth-child(1) a"
selector resolved to visible <a class="v-align-middle" href="/microsoft/playwrig…>…</a>
attempting click action
waiting for element to be visible, enabled and not moving
element is moving - waiting...
element is visible, enabled and does not move
scrolling into view if needed
done scrolling
checking that element receives pointer events at (468,222)
<div class="mr-3">↵ Apache-2.0 license↵ </div> from <div>…</div> subtree intercepts pointer events
retrying click action
waiting for element to be visible, enabled and not moving
element is moving - waiting...
element is visible, enabled and does not move
scrolling into view if needed
done scrolling
checking that element receives pointer events at (468,222)
<div class="mr-3">↵ Apache-2.0 license↵ </div> from <div>…</div> subtree intercepts pointer events
retrying click action
I'm on Windows 10.