我要先说我不太了解puppeteer,但似乎剧作家被创造为它的继任者,所以我想我直接跳到使用它。
使用本指南,我尝试配置 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.
任何人都有关于如何设置 Angular 的更好资源playwright
?