Example #1
0
 public void CloseAll()
 {
     try
     {
         extent.Close();
     }
     catch (Exception e)
     {
         throw (e);
     }
 }
        public void CloseReporterAndSendMessage()
        {
            try
            {
                Extent.Close();

                var senderNickname = "Lizy Flower";
                var from = "*****@*****.**";
                var to = "*****@*****.**";
                var subject = "Test results!";
                var body = "Test run is over! The report is attached to the letter.";
                var attachmentPath = "ExtentReports.html";
                GMailHelper.SendMessageWithAttachment(senderNickname, from, to, subject, body, attachmentPath);
            }
            catch (Exception exc)
            {
                throw exc;
            }
        }
Example #3
0
        public void ThenTestableOutcome1()
        {   //test data has to be parametersied
            //string expectedTitle="Scottish Widows | Pensions | Life insurance | Investments1";
            //have to think something about test data record & steps mapping class
            string expectedTitle = json.GetTestDataValue(1, "ExpectedPageTitle");
            bool   result1       = webutil.ValidatePageTitle(expectedTitle);

            if (result1 == true)
            {
                extent1.SetStepStatusPass("THEN the guest user should be able to see the Scottish Widows Home Page");
                extent1.SetTestStatusPass();
            }
            else
            {
                extent1.SetStepStatusFail("THEN the guest user should be able to see the Scottish Widows Home Page");
                extent1.SetTestStatusFail("The actual page title: '" + webutil.GetPageTitle() + "' is not same as the expected page title:'" + expectedTitle + "' ");
            }
            extent1.Close();
        }
Example #4
0
 public void ThenTestableOutcome2()
 {
     try
     {
         string expectedTitle = json.GetTestDataValue(1, "ExpectedPageTitle");
         bool   result1       = webutil.ValidatePageTitle(expectedTitle);
         if (result1 == true)
         {
             extent1.SetStepStatusPass("THEN user should be able to see the order confirmation");
             extent1.SetTestStatusPass();
         }
         else
         {
             extent1.SetStepStatusFail("THEN user should be able to see the order confirmation");
         }
         extent1.Close();
     }
     catch (Exception e)
     {
         Console.WriteLine("The exception handled -" + e.ToString());
     }
 }
Example #5
0
        public void ThenTestableOutcome1()
        {
            bool bRes = false;

            //please update the search text here accoding to api under test
            //we will have to discuss to check how to approach asserts & test passing and failing decision , I personally go with the boolean approach
            //keeping the variable failed as long as we have not done the final validations to make it true
            bRes = p1.ValidatePresenceOfText("Welcome to my rest assured project");
            //extent1.CreateTest(TestContext.CurrentContext.Test.Name);
            if (bRes == true)
            {
                extent1.SetStepStatusPass("Then the user should get desired response");
                extent1.SetTestStatusPass();
            }
            else
            {
                extent1.SetStepStatusFail("Then the user should get desired response");
                extent1.SetTestStatusFail("The searched text is not present in the response body");
            }

            extent1.Close();//to flush and close the extent report
        }
Example #6
0
 public static void CloseReporter()
 {
     extent.Close();
     //MailUtil.SendAttachedReport();
 }