public TestExecutionManager(TestDetails details) { this.Details = details; this.RemoteCommands = new List<RemoteCommandViewModel>(); foreach (var command in details.RemoteCommands) { this.RemoteCommands.Add(new RemoteCommandViewModel { CommandName = command.Key.GetType().Name, RemoteCommand = command.Key, RemoteCommandArguments = command.Value }); } // new test class so we can grab the proper provider FluentTest testClass = new FluentTest(); this.Manager = testClass.I; if (details.Browsers.Count > 0) { var selectedBrowser = details.Browsers[0]; this.Manager.Use(details.Browsers[0]); } }
public TestViewModel() { MessengerInstance.Register<GenericMessage<TestDetails>>(this, (test) => { DispatcherHelper.CheckBeginInvokeOnUI(() => { // only handle one test at a time! if (this.RemoteCommands.Count == 0) { this.Browsers = new ObservableCollection<BrowserType>(test.Content.Browsers); foreach (var commandItem in test.Content.RemoteCommands) { this.RemoteCommands.Add(new RemoteCommandViewModel { CommandName = commandItem.Key.GetType().Name, RemoteCommand = commandItem.Key, RemoteCommandArguments = commandItem.Value }); } this.Name = "Received at " + DateTime.Now.ToLongTimeString(); this.ExecuteButtonVisibility = this.RemoteCommands.Count == 0 ? Visibility.Collapsed : Visibility.Visible; // new test class so we can grab the proper provider FluentTest testClass = new FluentTest(); this._manager = testClass.I; if (this.Browsers.Count > 0) { var selectedBrowser = this.Browsers[0]; if (selectedBrowser == BrowserType.InternetExplorer) this._requiresSTA = true; this._manager.Use(this.Browsers[0]); } if (testClass.ProviderName.Contains("WatiN")) { this._requiresSTA = true; } } }); }); }