linux - TestCafe:导出命令在 Linux 中不起作用
问题描述
我正在使用 testcafe 进行自动化。
根据文档设置环境变量,我set
用于在本地export
运行的 Windows 以及使用 Jenkins 作业在 Linux 环境中运行测试。在 Windows 中,它工作得很好。但在 Linux 导出命令中没有设置环境变量。
我在 Windows 中使用的 shell 命令set ENV=staging& npx testcafe \"chrome:headless --no-sandbox --disable-dev-shm-usage\" automation_suite/tests
我在 Jenkins 中使用的 shell 脚本命令在 Linux Jenkins 管道脚本上运行
stage('Run tests') {
steps {
sh 'npm run ci360:smoketest:chrome:headless'
}
}
外壳命令
npm run ci360:smoketest:chrome:headless
会自动调用命令
export ENV=staging& npx testcafe \"chrome:headless --no-sandbox --disable-dev-shm-usage\" automation_suite/tests
在 package.json 的 scripts 部分定义
不知道这里有什么问题,我被困在这一点上。任何帮助表示赞赏。
解决方案
该问题已通过替换&
为;
推荐阅读
- reactjs - 使用 try/catch 处理 413(请求实体太大)错误
- c# - 找不到 net471 System.Configuration.Install 命名空间
- javascript - Promise.all 没有进入
- html - 如何更改行引导程序 3 中元素的顺序?
- c# - 如何从 URL 导入文本?
- git - 使用 fork 同步 github 上游
- python - TimeInput 的初始格式
- ftp - 使用 FileMaker 或 Applescript FTP 下载最新文件
- javascript - 如何在 HTML 中添加已保存的高分系统?
- r - 函数内的矩阵乘法导致错误消息