TestCafe没有在无头和UI模式下在ubuntu上运行

问题描述 投票:2回答:2

Testcafe测试未在Ubuntu(AWS机器)中运行

我已经为所有可用的浏览器执行了以下命令

testcafe "chrome" abc.js
testcafe "chrome:headless" abc.js

testcafe "firefox" abc.js
testcafe "firefox:headless" abc.js

testcafe "chromium" abc.js
testcafe "chromium:headless" abc.js

我有以下错误消息执行testcafe命令

错误:没有测试可以运行。测试文件不包含测试或过滤器功能限制太多。

javascript testing e2e-testing testcafe webautomation
2个回答
4
投票

ERROR Was unable to open the browser "chrome:headless" due to error. Error: EACCES: permission denied, mkdir '/tmp/testcafe/chrome-profile

看起来你试图在sudo运行后没有超级用户运行TestCafe。

我建议你删除/tmp/testcafe文件夹(sudo rm -rf /tmp/testcafe)并再次运行TestCafe(没有sudo)。


1
投票

命令:testcafe "chrome" abc.js表示文件abc.js必须位于当前工作目录中,以便testcafe命令找到此文件。

如果abc.js在子文件夹中,命令行应该是:

testcafe "chrome" ./**/abc.js

© www.soinside.com 2019 - 2024. All rights reserved.