public void ScreenshotMethod() { var s = new ScreenshotLog("page title", "reports/screenshot/lkfdkjdf.jpg", "name"); TestResultReporter.Log(s); Assembly.LoadFrom("somewhere."); }
public bool GetPupilBasicDetails() { var displayNamePopup = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId(cssforNamePopUp))); var pupilNamePopup = displayNamePopup[0].Text; /* Popup Pupil name*/ var displayGenderPopup = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId(cssforGenderPopUp))); var pupilGenderPopup = displayGenderPopup[0].Text; var displayDOBPopup = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId(cssforDOBPopUp))); var pupilDOBPopup = displayDOBPopup[0].Text; var elements = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId("PreferredListName_Learner"))); // Elements in result tile String Name = elements[0].Text; int index1 = Name.IndexOf(","); String PupilName1 = (Name.ToString().Substring((index1 + 2))); String PupilName2 = (Name.ToString().Substring(0, (index1))); String pupilName = PupilName1 + " " + PupilName2; StringAssert.AreEqualIgnoringCase(pupilName, pupilNamePopup, "Failed"); //Verify if name displayed in the new popup is same as name in the results fetched TestResultReporter.Log("<b>Pupil Name - </b> " + pupilNamePopup); TestResultReporter.Log("<b> Gender - </b>" + pupilGenderPopup); int index = pupilDOBPopup.IndexOf(':'); TestResultReporter.Log("<b> DOB - </b>" + pupilDOBPopup.ToString().Substring(index + 1)); return((pupilNamePopup != null) && (pupilGenderPopup != null) && (pupilDOBPopup != null)); // All are mandatory fields }
//Method to check for Name and DOB details for Pupil. public bool GetPupilBasicDetailsNameDOB() { var displayNamePopup = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId(cssforNamePopUp))); var pupilNamePopup = displayNamePopup[0].Text; var displayDOBPopup = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId(cssforDOBPopUp))); var pupilDOBPopup = displayDOBPopup[0].Text; var elements = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId("PreferredListName_Learner"))); String Name = elements[0].Text; String fName = Name.ToString().Substring((Name.IndexOf(",") + 2)); String lName = Name.ToString().Substring(0, Name.IndexOf(",")); String pupilName = fName + lName; StringAssert.AreNotEqualIgnoringCase(pupilName, pupilNamePopup, "Failed"); TestResultReporter.Log("<b>Pupil Name - </b> " + pupilNamePopup); int index = pupilDOBPopup.IndexOf(':'); TestResultReporter.Log("<b> DOB - </b>" + pupilDOBPopup.ToString().Substring(index + 1)); return((pupilNamePopup != null) && (pupilDOBPopup != null)); // All are mandatory fields }
//Method to check for gender details for Pupil - Returns true if Gender details are blank. public bool CheckPupilGenderDetailsForBlank() { var displayGenderPopup = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId(cssforGenderPopUp))); var pupilGenderPopup = displayGenderPopup[0].Text; TestResultReporter.Log("<b> Gender - </b>" + pupilGenderPopup); return(pupilGenderPopup == ""); }
public static void GoToRoomScreen() { var menu = new TaskMenuBar(); menu.ClickCommunicationTaskMenuBar(); SeleniumHelper.WaitForElementClickableThenClick(AddressBookElements.TGScreenLink); // menu.ClickSchoolManagementLink(); menu.ClickRoomLink(); TestResultReporter.Log("Successfully Navigated to Rooms Page"); }
public void Screenshot() { try { WebContext.Screenshot(); } catch (Exception e) { TestResultReporter.Log("Couldn't take screenshot " + e.Message); } }
public static void LogLinkVisibility(string screenName) { if (LoadedQuickSearchLink.Displayed) { TestResultReporter.Log("Quick Search Link is displayed on " + screenName); } else { TestResultReporter.Log("Quick Search Link is not displayed on " + screenName); } }
public bool GetClassYear() { var elements = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId("Learner_YearGroupClass"))); var resultCount = elements.Count; if (resultCount >= 1) { String pupilClassYear = elements[0].Text; TestResultReporter.Log("<b>Class/Year Group of this pupil is </b><b>" + pupilClassYear + "</b"); } return(elements[0].Text != null); }
public void GetPupilDetails() { if (HaveAssociatedPupil() >= 1) { for (int i = 1; i < HaveAssociatedPupil(); i++) { var elements = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId("contact_card_container"))); // Elements in result tile } } else { TestResultReporter.Log("No associated Pupils here"); } }
public bool IsAddressDisplayed() { try { WebContext.WebDriver.FindElement(AddressBookElements.AddressElement); IWebElement Address = WebContext.WebDriver.FindElement(By.CssSelector(SeleniumHelper.AutomationId("meaning_home_icon_basic"))); TestResultReporter.Log("<b> Address -</b> " + Address.Text); return(true); } catch (NoSuchElementException e) { return(false); } }
public bool IsEmailDisplayed() { try { WebContext.WebDriver.FindElement(AddressBookElements.EmailElement); IWebElement Email = WebContext.WebDriver.FindElement(By.CssSelector(SeleniumHelper.AutomationId("communication_email_basic"))); TestResultReporter.Log("<b>Email Address -</b> " + Email.Text); return(true); } catch (NoSuchElementException e) { return(false); } }
public bool IsPupilTelephoneDisplayed() { try { WebContext.WebDriver.FindElement(AddressBookElements.TelephoneElement); IWebElement PupilTelephone = WebContext.WebDriver.FindElement(By.CssSelector(SeleniumHelper.AutomationId("communication_telephone_basic"))); TestResultReporter.Log("<b>Telephone Number -</b> " + PupilTelephone.Text); return(true); } catch (NoSuchElementException e) { return(false); } }
private void SearchAndClickRoom(RoomPage roomPage, string shortRoomName, string longRoomName) { TestResultReporter.Log("Searching room >> " + shortRoomName); roomPage.EnterShortNameSearchPanel(shortRoomName); roomPage.EnterLongNameSearchPanel(longRoomName); roomPage.ClickSeachRoomButton(); SearchResults.WaitForResults(); Assert.IsTrue(SearchResults.HasResults(1)); TestResultReporter.Log(string.Format("Room '{0}' FOUND!!", shortRoomName)); roomPage.ClickSearchResults(); SearchResults.WaitForResults(); TestResultReporter.Log(string.Format("Opened Room '{0}'", shortRoomName)); }
public bool GetStaffBasicDetails() { var displayNamePopup = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId(cssforNamePopUp))); var staffNamePopup = displayNamePopup[0].Text; /* Popup Pupil name*/ var displayGenderPopup = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId(cssforGenderPopUp))); var staffGenderPopup = displayGenderPopup[0].Text; var elements = WebContext.WebDriver.FindElements(By.CssSelector(SeleniumHelper.AutomationId("search_result_tile_Staff"))); // Elements in result tile String Name = elements[0].Text; int index1 = Name.IndexOf(","); String StaffName1 = (Name.ToString().Substring((index1 + 2))); String StaffName2 = (Name.ToString().Substring(0, (index1))); String staffName = StaffName1 + " " + StaffName2; // StringAssert.AreEqualIgnoringCase(pupilContactName, pupilContactNamePopup, "Failed"); //Verify if name displayed in the new popup is same as name in the results fetched //Parul: Check for Title in names TestResultReporter.Log("<b>Staff Name - </b> " + staffNamePopup); TestResultReporter.Log("<b> Gender - </b>" + staffGenderPopup); return((staffNamePopup != null) && (staffGenderPopup != null)); // All are mandatory fields }
public void Log(string message) { TestResultReporter.Log(message); }