【发布时间】:2019-12-19 15:24:56
【问题描述】:
如果我使用测试脚本的绝对路径,我似乎只能运行单个 nightwatchjs 测试。
因此,例如,如果我从以下文件夹运行测试;
/Users/darrenharley/Documents/Git/uk-content-parkers/Tests/Functional/tests
以下内容;
npm run test:live /Users/darrenharley/Documents/Git/uk-content-parkers/Tests/Functional/tests/current_functionality/gamAds/PAR-5139.js
它工作正常。
但是,我需要在不使用本地文件结构的情况下运行此测试(因为最终将通过 Jenkins 构建运行,因此无法使用它)。
但是如果我使用以下内容运行测试;
npm run test:live ./current_functionality/gamAds/PAR-5139.js
失败,出现以下错误;
错误:ENOENT:没有这样的文件或目录,stat './current_functionality/gamAds/PAR-5139.js'
我在这里做错了什么吗?
如果有帮助,在我的 nightwatch.conf.js 文件中有这个;
src_folders: [
'tests/',
],
在我的 package.json 文件中有这个;
"test:live": "nightwatch --config config/nightwatch.conf.js --env live --suiteRetries 3",
任何帮助将不胜感激,因为这似乎是一件很基本的事情。
非常感谢。
【问题讨论】: