Java 如何通过批处理文件运行cucumber测试?

Java 如何通过批处理文件运行cucumber测试?,java,selenium,batch-file,cucumber,browser-automation,Java,Selenium,Batch File,Cucumber,Browser Automation,我想使用一个可执行的批处理文件来运行Cucumber特性,但不知道如何执行 我的批处理文件必须允许我有选择地运行测试用例,也就是说,通常基于标记或任何特定的功能文件。好吧,这里是一个起点: 在您的终端中: gedit myscript.sh 在脚本中编写以下内容: echo "starting script" cd /yourproject/homefolder mvn test -Dcucumber.options=”–tags @$1” echo "ending script" 保存脚本

我想使用一个可执行的批处理文件来运行Cucumber特性,但不知道如何执行


我的批处理文件必须允许我有选择地运行测试用例,也就是说,通常基于标记或任何特定的功能文件。

好吧,这里是一个起点: 在您的终端中:

gedit myscript.sh
在脚本中编写以下内容:

echo "starting script"
cd /yourproject/homefolder
mvn test -Dcucumber.options=”–tags @$1”
echo "ending script"
保存脚本,然后在终端中键入

chmod +x myscript.sh
那就这样说吧

./myscript.sh Smoke
myscript.bat Smoke
上面的命令使用标记烟雾运行所有场景

这都是我的想法,没有测试它,但它应该工作! myscript.bat的步骤与此相同 创建myscript.bat并在其中写入以下内容:

echo "starting script"
cd C://yourproject/homefolder
mvn test -Dcucumber.options=”–tags @$1”
echo "ending script"
那就这样说吧

./myscript.sh Smoke
myscript.bat Smoke

好吧,这是你的一个出发点: 在您的终端中:

gedit myscript.sh
在脚本中编写以下内容:

echo "starting script"
cd /yourproject/homefolder
mvn test -Dcucumber.options=”–tags @$1”
echo "ending script"
保存脚本,然后在终端中键入

chmod +x myscript.sh
那就这样说吧

./myscript.sh Smoke
myscript.bat Smoke
上面的命令使用标记烟雾运行所有场景

这都是我的想法,没有测试它,但它应该工作! myscript.bat的步骤与此相同 创建myscript.bat并在其中写入以下内容:

echo "starting script"
cd C://yourproject/homefolder
mvn test -Dcucumber.options=”–tags @$1”
echo "ending script"
那就这样说吧

./myscript.sh Smoke
myscript.bat Smoke