如何使用cucumber配置文件动态使用不同的环境主机名、测试数据和测试组。我正在使用cucumber、java和maven
我在功能文件中编写了测试用例。测试用例按照要求进行标记。 我希望通过传递概要文件名,使用maven命令在不同的环境中执行这些测试用例。 每个配置文件都有特定环境的主机名、用户名和密码。 我如何做到这一点如何使用cucumber配置文件动态使用不同的环境主机名、测试数据和测试组。我正在使用cucumber、java和maven,maven,cucumber,Maven,Cucumber,我在功能文件中编写了测试用例。测试用例按照要求进行标记。 我希望通过传递概要文件名,使用maven命令在不同的环境中执行这些测试用例。 每个配置文件都有特定环境的主机名、用户名和密码。 我如何做到这一点 @stage_ready Feature: GUI Tests Background: Given the site <hostname> is reached using "Chrome" browser When maximize window And c
@stage_ready
Feature: GUI Tests
Background:
Given the site <hostname> is reached using "Chrome" browser
When maximize window
And credentials <user_host> is typed into the "sd_username_editbox"
And credentials <password_host> is typed into the "sd_password_editbox"
And the "sd_login_button" button is clicked
我想知道如何编写配置文件,该配置文件将包含不同配置文件的主机名、用户主机、密码主机等参数,并在cucumber步骤中动态使用,我已在尖括号中标记以供参考。来自:
“配置文件在Java中不可用。”
如果要将参数传递给Maven,可以使用
例如(从上面的Maven链接):
...
appserverConfig开发
环境
发展
/路径/to/dev/appserver
appserverConfig-dev-2
环境
dev-2
/路径/to/other/dev/appserver2
..
来自:
“配置文件在Java中不可用。”
如果要将参数传递给Maven,可以使用
例如(从上面的Maven链接):
...
appserverConfig开发
环境
发展
/路径/to/dev/appserver
appserverConfig-dev-2
环境
dev-2
/路径/to/other/dev/appserver2
..
Hi,有人能告诉我如何将maven profile与cucumber结合使用吗?我已经在POM中创建了配置文件,但它是在cucumber测试之后执行的。我希望在测试之前执行,以便在测试开始之前完成maven ant任务。请检查嗨,有人能告诉我如何使用maven profile和cucumber吗?我已经在POM中创建了配置文件,但它是在cucumber测试之后执行的。我希望在测试之前执行,以便在测试开始之前完成maven ant任务。请查收
mvn test -Dcucumber.options=”–tags @stage_ready” -p profile_name
<project>
...
<profiles>
<profile>
<id>appserverConfig-dev</id>
<activation>
<property>
<name>env</name>
<value>dev</value>
</property>
</activation>
<properties>
<appserver.home>/path/to/dev/appserver</appserver.home>
</properties>
</profile>
<profile>
<id>appserverConfig-dev-2</id>
<activation>
<property>
<name>env</name>
<value>dev-2</value>
</property>
</activation>
<properties>
<appserver.home>/path/to/another/dev/appserver2</appserver.home>
</properties>
</profile>
</profiles>
..
</project>