public void TEST_SearcForBg() { string subject = "", body = ""; string url = ""; SearchListPage.WriteInto("TEST_SearcForBg" + "_Start of Test_" + DateTime.Now.ToString("(dd_MMMM_hh_mm_ss_tt)")); SearchListPage.WriteInto("Start of Login"); TestParametar parameters = new TestParametar(); url = parameters.url; LoginPage.GoTo(url); string TestName = "SearchForBg"; string folderpath = @"C:/ScreenShot/" + TestName + "/"; SearchListPage.WriteInto("Start of DeleteFolder"); SearchForBgList.DeleteFolder(folderpath); SearchListPage.WriteInto("Start of CreateFolder"); SearchForBgList.CreateFolder(folderpath); SearchListPage.WriteInto("Start of Searching Image"); string imageMessage = SearchForBgList.SearchImageOnGoogle("Beograd", 4); SearchListPage.WriteInto("End of Searching"); subject = "Moj treci test"; if (!imageMessage.Contains("ERROR")) { subject = "Passed!!! " + subject; body = "Google image upload option works properly" + "\n" + imageMessage; } else { subject = "Failed!!! " + subject; body = imageMessage; } SearchListPage.WriteInto("Start of Attachment"); SearchForBgList.SendEmailAttachment(subject, body, TestName); SearchListPage.WriteInto("End of Attachment"); Assert.IsTrue(subject.Contains("Passed")); Assert.IsFalse(subject.Contains("Failed")); SearchListPage.WriteInto(TestName + "_End of Test_" + DateTime.Now.ToString("(dd_MMMM_hh_mm_ss_tt)")); }
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")); }
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")); }