在Jenkins中,我使用SSH插件通过ssh在远程计算机上运行shell命令.我已将SSH站点添加到全局配置中.但是在我的Jobs配置的"使用ssh的远程主机上执行shell脚本"部分,而不是从下拉列表中选择一个SSH站点,我想使用构建参数.这样我想根据我的要求将这项工作概括为远程到不同的环境.
有没有办法参数化ssh站点下拉?或者以不同的方式达到我的要求?
BTW我已经拥有的一个选项是,将ssh作为脚本的一部分用于远程机器并在那里执行.
我正在使用Maven Failsafe + TestNG来运行Selenium测试.我知道可以通过在pom.xml中定义系统属性来将参数传递给我的TestNG测试,如下所示:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<systemPropertyVariables>
<browser>firefox</browser>
</systemPropertyVariables>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我的TestNG测试将此属性称为:
@Parameters("browser")
public void setUpClass(@Optional("firefox") String browser)
{
...
}
Run Code Online (Sandbox Code Playgroud)
但是,我想知道是否可以并行运行跨浏览器测试而无需指定testng.xml文件.我正在尝试这样的事情,但它没有用.感谢您是否可以提供帮助.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<systemPropertyVariables>
<browser>firefox, chrome</browser>
</systemPropertyVariables>
<parallel>tests</parallel>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
是否可以通过pom.xml配置实现这一目标?由于我的项目具有多模块特性,我并不热衷于使用testng.xml文件.