【发布时间】:2019-11-29 11:40:07
【问题描述】:
我有一个 Java 自动化测试框架。我需要这段代码在 SIT、UAT 和 Prod 等多个环境中运行,但所有这些环境都有不同的 URL。
sit-config.properties
主页 = XXX
uat-config.properties
主页 = YYY
Maven 配置文件
<profiles>
<profile>
<id>sit</id>
<activation>
<property>
<name>environment</name>
<value>sit</value>
</property>
</activation>
</profile>
<!-- mvn -Denvironment=sit clean test -->
<profile>
<id>uat</id>
<activation>
<property>
<name>environment</name>
<value>uat</value>
</property>
</activation>
</profile>
</profiles>
我有一个 Java Owner 库的示例,但 testng 不是 Maven。 http://www.testautomationguru.com/selenium-webdriver-how-to-execute-tests-in-multiple-environments/
问题: 如何将 Java Owner 库与 Maven 配置文件集成?
请帮忙。谢谢。
【问题讨论】: