Beispiel #1
0
        public void TEST_PHPTravels()
        {
            string subject = "",
                   body    = "";

            TestParametar parameters = new TestParametar();
            string        url        = parameters.url;

            LoginPage.GoTo(url);

            string TestName   = "PHPTravels";
            string folderpath = @"C:/ScreenShot/" + TestName + "/";

            SearchForBgList.DeleteFolder(folderpath);

            SearchForBgList.CreateFolder(folderpath);

            string phpMessage   = PHPTravelsFunction.SearchPHPTravelsOnGoogle("PHP Travels");
            string loginMessage = PHPTravelsFunction.LoginOnPHPTravels("*****@*****.**", "monzza");


            subject = "Moj peti test";

            if (!phpMessage.Contains("ERROR") && (!loginMessage.Contains("ERROR")))
            {
                subject = "Passed!!! " + subject;
                body    = "Test have error" + "\n" + phpMessage + loginMessage;
            }
            else
            {
                subject = "Failed!!! " + subject;
                body    = phpMessage + loginMessage;
            }

            SearchForBgList.SendEmailAttachment(subject, body, TestName);

            Assert.IsTrue(subject.Contains("Passed"));
            Assert.IsFalse(subject.Contains("Failed"));
        }
Beispiel #2
0
        public void TEST_PHPTravels_Email()
        {
            string subject = "",
                   body    = "";

            TestParametar parameters = new TestParametar();
            string        url        = parameters.url;

            LoginPage.GoTo(url);

            string TestName   = "PHPTravels_Email";
            string folderpath = @"C:/ScreenShot/" + TestName + "/";

            SearchForBgList.DeleteFolder(folderpath);

            SearchForBgList.CreateFolder(folderpath);

            string phpMessage   = PHPTravelsFunction.SearchPHPTravelsOnGoogle("PHP Travels");
            string emailMessage = PHPTravelsFunction.EmailPHPTravels();

            subject = "Moj deseti test";

            if (!phpMessage.Contains("ERROR") && (!emailMessage.Contains("ERROR")))
            {
                subject = "Passed!!! " + subject;
                body    = "The test has passed" + "\n" + phpMessage + emailMessage;
            }
            else
            {
                subject = "Failed!!! " + subject;
                body    = phpMessage + emailMessage;
            }

            SearchForBgList.SendEmailAttachment(subject, body, TestName);

            Assert.IsTrue(subject.Contains("Passed"));
            Assert.IsFalse(subject.Contains("Failed"));
        }