我首先要说的是,我对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的参考资料
发布于 2020-02-22 06:42:35
错误字符串显示Chromium无法找到共享库(libx11
)。这通常意味着您的系统缺少系统依赖项。如果你使用的是Ubuntu,你可以在3个捆绑的浏览器上使用this list of system dependencies。
https://stackoverflow.com/questions/60243012
复制相似问题