【发布时间】:2017-03-02 20:37:01
【问题描述】:
我们使用 .csx 文件来存储我们的 UI 自动化解决方案的某些参数,例如我们希望运行测试的浏览器和 Selenium Grid URL。我们还使用 TeamCity Enterprise 10.0.3(内部版本 42434)来构建和运行我们的测试。我看过TeamCity documentation,但不太明白怎么做。
问题:如何配置构建以使用参数换出 CSX 文件中存储的值?
这是我的 CSX 文件(称为 SettingsData.csx):
string BrowserValue = "chrome";
string BrowserMobileValue = "Samsung Galaxy S4";
string DeviceValue = "Samsung Galaxy S4";
string EnvironmentValue = "Live";
string FeatureBranchValue = "";
string FeatureIdValue = "";
string GridUrlValue = "http://IE-SLM-HUB:5555/wd/hub";
string PlatformValue = "";
string ResolutionValue = "default";
string ScreenWidthValue = "1280";
string ScreenHeightValue = "960";
Dictionary<string, object> SeleniumGridSetupValue = new Dictionary<string, object>
{
{"browserName", "chrome"}
};
Dictionary<string, object> SeleniumGridMobileSetupValue = new Dictionary<string, object>
{
{"browserName", "chrome"}
};
如果有人可以提供我如何使用参数来换出这些值之一的示例,我将不胜感激。
【问题讨论】: