/// <summary> /// Initializes a new instance of the <see cref="BrowserStackHelper{T}"/> class. /// </summary> /// <param name="browserStackSettings">The BrowserStack settings.</param> public BrowserStackHelper(BrowserStackSettings browserStackSettings) { this.BrowserStackSettings = browserStackSettings; if (string.IsNullOrEmpty(this.BrowserStackSettings.Username) || string.IsNullOrEmpty(this.BrowserStackSettings.AccessKey)) { throw new ConfigurationErrorsException("Unable to initialise the BrowserStackSetup class as the settings do not contain a Browserstack username and/or password. You can set this configuration in the appsettings.json file."); } if (!this.RecognisedBrowsers.Contains(this.BrowserStackSettings.BrowserName.Trim().ToLower(CultureInfo.CurrentCulture))) { throw new ConfigurationErrorsException($"Unable to initialise the BrowserStackHelper class as the browser '{this.BrowserStackSettings.BrowserName}' was not recognised."); } this.AdditionalCapabilities.Add("browser", this.BrowserStackSettings.BrowserName); this.AdditionalCapabilities.Add("browser_version", this.BrowserStackSettings.BrowserVersion); this.AdditionalCapabilities.Add("os", this.BrowserStackSettings.OperatingSystem); this.AdditionalCapabilities.Add("os_version", this.BrowserStackSettings.OperatingSystemVersion); this.AdditionalCapabilities.Add("resolution", this.BrowserStackSettings.ScreenResolution); this.AdditionalCapabilities.Add("browserstack.user", this.BrowserStackSettings.Username); this.AdditionalCapabilities.Add("browserstack.key", this.BrowserStackSettings.AccessKey); this.AdditionalCapabilities.Add("build", this.BrowserStackSettings.Build); this.AdditionalCapabilities.Add("project", this.BrowserStackSettings.Project); this.AdditionalCapabilities.Add("browserstack.debug", this.BrowserStackSettings.EnableDebug); this.AdditionalCapabilities.Add("browserstack.networkLogs", this.BrowserStackSettings.EnableNetworkLogs); this.AdditionalCapabilities.Add("browserstack.timezone", "Europe/London"); this.AdditionalCapabilities.Add("browserstack.video", this.BrowserStackSettings.RecordVideo); this.AdditionalCapabilities.Add("browserstack.seleniumLogs", this.BrowserStackSettings.EnableSeleniumLogs); this.AdditionalCapabilities.Add("name", this.BrowserStackSettings.Name); }
public ConfigSettings() { runTimeSettings = new RuntimeSettings(); reportSettings = new ReportSettings(); httpProxy = new HttpProxy(); imageCompareSettings = new ImageCompareSettings(); purpleSettings = new PurpleSettings(); browserStackSettings = new BrowserStackSettings(); sauceLabsSettings = new SauceLabsSettings(); }
static BrowserStackSettingsProvider() //TODO: Need to make it so user can set those setting for each profile { _profile1Settings = new BrowserStackSettings { BuildNumber = "", Project = "", SessionUrl = "www.browserstack.com/automate/sessions/", Local = false }; _profile2Settings = new BrowserStackSettings { BuildNumber = "", Project = "", SessionUrl = "www.browserstack.com/automate/sessions/", Local = false }; }
public static IBrowserStackApi Create(BrowserStackSettings settings) { return(Create(settings.Username, settings.AccessKey, settings.Timeout)); }
public ConfigurationSettings() { RuntimeSettings = new RuntimeSettings(); BrowserStackSettings = new BrowserStackSettings(); AppiumSettings = new AppiumSettings(); }