private void XDynamicRadioButton_Checked(object sender, RoutedEventArgs e) { if (mCLIDynamicFile == null) { mCLIDynamicFile = new CLIDynamicFile(CLIDynamicFile.eFileType.JSON); GingerCore.General.FillComboFromEnumObj(xDynamicFileTypeCombo, mCLIDynamicFile.FileType); BindingHandler.ObjFieldBinding(xDynamicFileTypeCombo, ComboBox.TextProperty, mCLIDynamicFile, nameof(CLIDynamicFile.FileType)); } if (mAutoRunWizard != null) { mAutoRunWizard.AutoRunConfiguration.SelectedCLI = mCLIDynamicFile; ShowHelp(); ShowContent(); } xConfigFileSettingsPnl.Visibility = Visibility.Visible; }
public void DyanamicRunsetXMLCreationTest() { //Arrange RunSetConfig runSetConfigurations = CreteRunsetWithOperations(); RunsetExecutor GMR = new RunsetExecutor(); GMR.RunsetExecutionEnvironment = environment; GMR.RunSetConfig = runSetConfigurations; CLIHelper cLIHelper = new CLIHelper(); cLIHelper.RunAnalyzer = true; cLIHelper.ShowAutoRunWindow = false; cLIHelper.DownloadUpgradeSolutionFromSourceControl = false; RunSetAutoRunConfiguration autoRunConfiguration = new RunSetAutoRunConfiguration(solution, GMR, cLIHelper); CLIDynamicFile mCLIDynamicXML = new CLIDynamicFile(CLIDynamicFile.eFileType.XML); autoRunConfiguration.SelectedCLI = mCLIDynamicXML; //Act //Creating XML file content from above configurations string file = autoRunConfiguration.SelectedCLI.CreateConfigurationsContent(solution, GMR, cLIHelper); //Assert //validate the 'AddRunsetOperation' tag XElement nodes = XElement.Parse(file); List <XElement> AddRunsetOPerationsNodes = nodes.Elements("AddRunsetOperation").ToList(); XmlDocument xDoc = new XmlDocument(); xDoc.LoadXml(file); XmlNodeList runsetoperations = xDoc.GetElementsByTagName("AddRunsetOperation"); //Assert Assert.AreEqual(runsetoperations.Count, 3); Assert.AreEqual(runsetoperations[0].FirstChild.Name, "MailFrom"); Assert.AreEqual(runsetoperations[0].LastChild.Name, "IncludeAttachmentReport"); Assert.AreEqual(runsetoperations[1].FirstChild.Name, "HTMLReportFolderName"); Assert.AreEqual(runsetoperations[1].LastChild.Name, "isHTMLReportPermanentFolderNameUsed"); Assert.AreEqual(runsetoperations[2].HasChildNodes, false); }
private void XDynamicRadioButton_Checked(object sender, RoutedEventArgs e) { if (mCLIDynamicFile == null) { mCLIDynamicFile = new CLIDynamicFile(CLIDynamicFile.eFileType.JSON); GingerCore.General.FillComboFromEnumObj(xDynamicFileTypeCombo, mCLIDynamicFile.FileType); BindingHandler.ObjFieldBinding(xDynamicFileTypeCombo, ComboBox.TextProperty, mCLIDynamicFile, nameof(CLIDynamicFile.FileType)); } if (mAutoRunWizard != null) { mAutoRunWizard.AutoRunConfiguration.SelectedCLI = mCLIDynamicFile; mAutoRunWizard.AutoRunConfiguration.AutoRunEexecutorType = eAutoRunEexecutorType.DynamicFile; ShowHelp(); ResetCLIContent(mAutoRunWizard.ResetCLIContent = true); ShowContent(); } xConfigFileSettingsPnl.Visibility = Visibility.Visible; xDynamicFileTypeCombo.Visibility = Visibility.Collapsed; xCLIContentTextBox.AddValidationRule(new ValidateJsonFormat()); }
public void DynamicRunetExecutionTest() { //Arrange ObservableList <BusinessFlow> bfList = SR.GetAllRepositoryItems <BusinessFlow>(); BusinessFlow BF1 = bfList[0]; ObservableList <Activity> activityList = BF1.Activities; Activity activity = activityList[0]; BF1.Active = true; GingerRunner mGRForRunset = new GingerRunner(); mGRForRunset.Name = "Test Runner"; Agent a = new Agent(); a.DriverType = Agent.eDriverType.SeleniumChrome; mGRForRunset.SolutionAgents = new ObservableList <Agent>(); mGRForRunset.SolutionAgents.Add(a); mGRForRunset.ApplicationAgents.Add(new ApplicationAgent() { AppName = "SCM", Agent = a }); mGRForRunset.SolutionApplications = new ObservableList <ApplicationPlatform>(); mGRForRunset.SolutionApplications.Add(new ApplicationPlatform() { AppName = "SCM", Platform = ePlatformType.Web, Description = "New application" }); mGRForRunset.BusinessFlows.Add(BF1); WorkSpace.Instance.SolutionRepository = SR; mGRForRunset.SpecificEnvironmentName = environment.Name; mGRForRunset.UseSpecificEnvironment = false; RunSetConfig runSetConfig1 = new RunSetConfig(); mGRForRunset.IsUpdateBusinessFlowRunList = true; runSetConfig1.GingerRunners.Add(mGRForRunset); runSetConfig1.UpdateRunnersBusinessFlowRunsList(); runSetConfig1.mRunModeParallel = false; RunSetActionHTMLReport produceHTML2 = CreateProduceHTMlOperation(); runSetConfig1.RunSetActions.Add(produceHTML2); RunsetExecutor GMR1 = new RunsetExecutor(); GMR1.RunsetExecutionEnvironment = environment; GMR1.RunSetConfig = runSetConfig1; WorkSpace.Instance.RunsetExecutor = GMR1; CLIHelper cLIHelper1 = new CLIHelper(); cLIHelper1.RunAnalyzer = false; cLIHelper1.ShowAutoRunWindow = false; cLIHelper1.DownloadUpgradeSolutionFromSourceControl = false; RunSetAutoRunConfiguration autoRunConfiguration1 = new RunSetAutoRunConfiguration(solution, GMR1, cLIHelper1); CLIDynamicFile mCLIDynamicXML1 = new CLIDynamicFile(CLIDynamicFile.eFileType.XML); autoRunConfiguration1.SelectedCLI = mCLIDynamicXML1; String xmlFile = autoRunConfiguration1.SelectedCLI.CreateConfigurationsContent(solution, GMR1, cLIHelper1); autoRunConfiguration1.CreateContentFile(); CLIProcessor cLIProcessor = new CLIProcessor(); string[] args = new string[] { autoRunConfiguration1.SelectedCLI.Verb, "--" + CLIOptionClassHelper.FILENAME, autoRunConfiguration1.ConfigFileFullPath }; //Act cLIProcessor.ExecuteArgs(args); //Assert string path = TestResources.GetTestResourcesFolder(@"Solutions" + Path.DirectorySeparatorChar + "BasicSimple" + Path.DirectorySeparatorChar + "Reports" + Path.DirectorySeparatorChar + "Reports"); Assert.IsTrue(Directory.Exists(path)); }