【发布时间】:2021-12-25 02:11:25
【问题描述】:
我有一个关于在 docker 容器中运行 cypress 的快速问题(对 Docker 没有太多经验,如果这是一个愚蠢的问题,请见谅)
假设我的脚本部分是这样的:
"scripts": {
"clean:reports": "rmdir /S /Q cypress\\reports && mkdir cypress\\reports && mkdir cypress\\reports\\mochareports",
"pretest": "npm run clean:reports",
"scripts": "cypress run",
"combine-reports": "mochawesome-merge cypress/reports/mocha/*.json > cypress/reports/mochareports/report.json",
"generate-report": "marge cypress/reports/mochareports/report.json -f report -o cypress/reports/mochareports",
"posttest": "npm run combine-reports && npm run generate-report",
"test" : "npm run scripts || npm run posttest"
},
我的 dockerfile 入口点如下:
ENTRYPOINT ["npm","run"]
但是当我从“docker run”命令行运行 cypress 时,我需要传递一些参数...有没有办法传递参数(例如带有要执行的规范文件名的 --spec 参数)考虑“测试”脚本有两个命令?
我传递的参数是否仅适用于“npm run scripts”?还是两个命令都会收到?
谢谢
【问题讨论】:
标签: docker automation parameters scripting cypress