gpt4 book ai didi

angular - 配置 Angular 以使用 playwright

转载 作者:行者123 更新时间:2023-12-04 10:34:38 26 4
gpt4 key购买 nike

我要先说我不知道​​ puppeteer好吧,但看起来是 playwright被创建为它的继任者,所以我想我只是直接跳到使用它。

使用此 guide我试图像我一样配置 Karma 和 Protractor puppeteer仅替换 playwright我被告知要放的地方puppeteer反而。

这条线

process.env.CHROME_BIN = require('playwright').executablePath();

但是作为 playwright 不起作用没有 exectablePath()功能本身

相反,我试过
process.env.CHROME_BIN = require('playwright').chromium.executablePath()

这似乎会做我想做的。但是我仍然收到以下错误消息。尝试运行时 ng test --watch=false
 40% building 84/84 modules 0 active15 02 2020 20:41:52.310:INFO [launcher]: Trying to start ChromeHeadless again (2/2).
15 02 2020 20:41:52.360:ERROR [launcher]: Cannot start ChromeHeadless
/workspace/vr2k2/node_modules/playwright-core/.local-chromium/linux-740847/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

15 02 2020 20:41:52.360:ERROR [launcher]: ChromeHeadless stdout:
15 02 2020 20:41:52.361:ERROR [launcher]: ChromeHeadless stderr: /workspace/vr2k2/node_modules/playwright-core/.local-chromium/linux-740847/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

15 02 2020 20:41:52.436:ERROR [launcher]: ChromeHeadless failed 2 times (cannot start). Giving up.

任何人都有关于如何使用 playwright 设置 Angular 的更好资源?

最佳答案

错误字符串显示 Chromium 无法找到共享库 ( libx11 )。这通常意味着您的系统缺少系统依赖项。如果您使用的是 Ubuntu,则可以使用 this list of system dependencies对于 3 个捆绑的浏览器。

关于angular - 配置 Angular 以使用 playwright,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60243012/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com