private void StudioVersionAdded(object sender, VersionEventArgs e) { BrowserType type = GetBrowserType(e.Version.Settings.GetMultipleChoiceSetting("BrowserType")); if (!Selenium.ContainsKey(type)) { (bool debugModeOn, SettingsCollection browserSettings)settings = GetDebugSettings(Studio.CurrentProject.Settings.GetSubSettings("debugSettings"), type); Studio.ScheduleBackgroundTask(new StartSeleniumTask(type, settings.browserSettings)); } }
private void RestartSelenium(SettingsCollection projectSettings, BrowserType browserType) { if (VersionForBrowserExists(browserType)) { (bool debugModeOn, SettingsCollection browserSettings)settings = GetDebugSettings(projectSettings.GetSubSettings("debugSettings"), browserType); if (settings.debugModeOn) { if (!CheckSelenium(browserType)) { Studio.CancelScheduledBackgroundTask("start" + GetBrowserTypeString(browserType)); Studio.ScheduleBackgroundTask(new StartSeleniumTask(browserType, settings.browserSettings)); } } } }
private void StartSelenium() { List <BrowserType> typesToStart = new List <BrowserType>(); foreach (Models.Version version in Studio.CurrentProject.Versions) { if (!typesToStart.Contains(GetBrowserType(version.Settings.GetMultipleChoiceSetting("BrowserType")))) { typesToStart.Add(GetBrowserType(version.Settings.GetMultipleChoiceSetting("BrowserType"))); } } foreach (BrowserType type in typesToStart) { (bool debugModeOn, SettingsCollection browserSettings)settings = GetDebugSettings(Studio.CurrentProject.Settings.GetSubSettings("debugSettings"), type); StartSeleniumTask task = new StartSeleniumTask(type, settings.browserSettings); task.Id = "start" + GetBrowserTypeString(type); task.Executed += SeleniumStarted; Studio.ScheduleBackgroundTask(task); } }