作为用户,我想通过一些命令行选项执行Robot Framework的robot
命令。我将所有内容放在脚本中,以避免每次都重新键入长命令-请参见下面的示例。在Linux和Mac OS上,我可以从任何终端仿真器(即
# Linux
. run_local_tests.sh
# Mac OS
./run_local_tests.sh
在Windows上,打开了与.sh
文件类型关联的应用程序(VSCode编辑器),而不是执行robot
命令,或者返回了类似robot: command not found
的错误
# Windows
.\run_local_tests.sh
# OR
run_local_tests.sh
# OR
bash run_local_tests.sh
shell脚本-文件名:run_local_tests.sh
#!/bin/bash # Set desired loglevel: NONE (less details),INFO,DEBUG,TRACE (most details) export LOG_LEVEL=TRACE # RUN CONTRIBUTION SERVICE TESTS robot -i CONTRIBUTION -e circleci \ --outputdir results \ --log NONE \ --report NONE \ --output XML/CONTRIBUTION.xml \ --noncritical not-ready \ --flattenkeywords for \ --flattenkeywords foritem \ --flattenkeywords name:_resources.* \ --loglevel $LOG_LEVEL \ --name CONTRI \ robot/CONTRIBUTION_TESTS/
- 将脚本从
.sh
重命名为.bat
并没有帮助:( - 输入
bash
,然后激活venv并调用脚本不起作用
还有哪些其他选项(无需安装Cygwin等其他工具)?