Playwright Webkit在Windows 10上不起作用

问题描述

我正在尝试编写一个简单的e2e测试。

Hoxton.SR7

代码与铬和Firefox兼容。但是,当我使用webkit时,它在the second screen上中断。 Webkit错误日志:

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();
    }
})();

我在Windows 10上。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)