Exemplo n.º 1
0
        public void MavenFreeCommandXmlParametersOverrideOnOriginalXmlExecutionTest()
        {
            //Arrange
            TestNGExecuterService service = new TestNGExecuterService();
            GingerAction          GA      = new GingerAction();

            List <TestNGTestParameter> paramsToOveride = new List <TestNGTestParameter>();

            paramsToOveride.Add(new TestNGTestParameter()
            {
                Name = "Num1", Value = "6"
            });
            paramsToOveride.Add(new TestNGTestParameter()
            {
                Name = "Num2", Value = "7"
            });

            //Act
            service.ExecuteMavenFreeCommand(GA, OverwriteMavenHomePath: null, MavenProjectFolderPath: TestResources.GetTestResourcesFolder(@"MavenTestNG"),
                                            FreeCommandArguments: "clean install test -DsuiteXmlFile=\"src/main/java/com/Calculator/testng.xml\"",
                                            TestngXmlPath: Path.Combine(TestResources.GetTestResourcesFolder("MavenTestNG"), "src", "main", "java", "com", "Calculator", "testng.xml"), TestngXmlParametersToOverwrite: paramsToOveride, OverwriteOriginalTestngXml: true,
                                            ParseConsoleOutputs: true, FailActionDueToConsoleErrors: false,
                                            ParseTestngResultsXml: true, OverwriteTestngResultsXmlDefaultFolderPath: null, FailActionDueToTestngResultsXmlFailures: true);

            //Assert
            Assert.AreEqual((GA.Errors == null || GA.Errors.Count() == 0), true, "No Execution Errors validation");
            Assert.AreEqual((GA.Output != null && GA.Output.OutputValues.Count > 0), true, "Execution Output values found validation");
            Assert.AreEqual(General.OutputParamExist(GA, "Multipliy Result", "42"), true, "Console Multipliy Output captured validation");
            Assert.AreEqual(General.OutputParamExist(GA, "Sum Result", "13"), true, "Console Sum Output captured validation");
            Assert.AreEqual(General.OutputParamExist(GA, "Total Passed Test Methods", "2"), true, "TestNg Report XML Statistics Parsing validation");
            Assert.AreEqual(General.OutputParamExist(GA, "CalculatorTests- Suite Start Time"), true, "TestNg Report XML Suite details Parsing validation");
            Assert.AreEqual(General.OutputParamExist(GA, @"test1\testMoltiple-Test Status", "PASS"), true, "TestNg Report XML Test 1 Status Parsing validation");
            Assert.AreEqual(General.OutputParamExist(GA, @"test1\testSum-Test Status", "PASS"), true, "TestNg Report XML Test 2 Status Parsing validation");
        }
Exemplo n.º 2
0
        public void MavenFreeCommandExecutionTest()
        {
            //Arrange
            TestNGExecuterService service = new TestNGExecuterService();
            GingerAction          GA      = new GingerAction();

            //Act
            service.ExecuteMavenFreeCommand(GA, OverwriteMavenHomePath: null, MavenProjectFolderPath: TestResources.GetTestResourcesFolder(@"MavenTestNG"),
                                            FreeCommandArguments: "clean install test -DsuiteXmlFile=\"src/main/java/com/Calculator/testng.xml\"",
                                            TestngXmlPath: null, TestngXmlParametersToOverwrite: null, OverwriteOriginalTestngXml: false,
                                            ParseConsoleOutputs: false, FailActionDueToConsoleErrors: false,
                                            ParseTestngResultsXml: true, OverwriteTestngResultsXmlDefaultFolderPath: null, FailActionDueToTestngResultsXmlFailures: true);

            //Assert
            Assert.AreEqual((GA.Errors == null || GA.Errors.Count() == 0), true, "No Execution Errors validation");
            Assert.AreEqual((GA.Output != null && GA.Output.OutputValues.Count > 0), true, "Execution Output values found validation");
            Assert.AreEqual(General.OutputParamExist(GA, "CalculatorTests- Suite Start Time"), true, "TestNg Report XML Suite details Parsing validation");
            Assert.AreEqual(General.OutputParamExist(GA, @"test1\testMoltiple-Test Status", "PASS"), true, "TestNg Report XML Test 1 Status Parsing validation");
            Assert.AreEqual(General.OutputParamExist(GA, @"test1\testSum-Test Status", "PASS"), true, "TestNg Report XML Test 2 Status Parsing validation");
        }