剧作家webkit不在Windows 10上工作

剧作家webkit不在Windows 10上工作,webkit,playwright,Webkit,Playwright,我想写一个简单的e2e测试 import {chromium, webkit, firefox} from "playwright"; (async () => { for (const browserType of [chromium, firefox, webkit]) { const browser = await browserType.launch({ headless: false }); const context

我想写一个简单的e2e测试

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();
    }
})();
这段代码在chromium和firefox上运行良好。但是,当我使用webkit时,它会断开。 Webkit错误日志:

 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
错误。captureStackTrace(stackObject);
^
page.click:协议错误(Runtime.WaitPromise):页面已关闭。
========================================日志===========================
正在等待选择器“.repo列表项:第n个子项(1)a”
选择器解析为可见
正在尝试单击操作
等待元素可见、启用且不移动
元素正在移动-等待。。。
元素可见、已启用且不移动
如果需要,滚动到视图中
完成滚动
检查元素是否在(468222)处接收指针事件
↵            Apache-2.0许可证↵           从…子树截取指针事件
重试单击操作
等待元素可见、启用且不移动
元素正在移动-等待。。。
元素可见、已启用且不移动
如果需要,滚动到视图中
完成滚动
检查元素是否在(468222)处接收指针事件
↵            Apache-2.0许可证↵           从…子树截取指针事件
重试单击操作

我使用的是Windows 10。

您的代码对我有效。你在运行Playwright 1.4吗?是的,我在运行Playwright 1.4。你的Node.Js版本是什么?对我来说,它在Win10上工作,节点为v12.16.1和PlayWriter 1.4。它可能值得一次干净的node_模块安装(在删除锁文件之后)。我的node.Js版本是12.14.1。我尝试清理并安装node_模块,但没有任何更改。我更新了Node.js版本,现在我在14.10.1上,干净地安装了Node_模块,问题仍然存在。我尝试安装Node v12.16.1,但没有效果。