public void WhenIEnterTheNotificationDetails(Table table) { var notificationparams = table.CreateInstance <NotificationParamaters>(); NotificationPage notificationpage = new NotificationPage(); notificationpage.WaitForThePageToLoad(); Utilities util = new Utilities(); string timestamp = util.Gettimestamp(); notificationpage.enterNameField(notificationparams.notificationname + timestamp); ScenarioContext.Current.Add("notificationname", notificationparams.notificationname + timestamp); notificationpage.SelectEventSelectBox(notificationparams.eventname); ScenarioContext.Current.Add("eventselected", notificationparams.eventname); notificationpage.SelectTemplateSelectBox(notificationparams.templateType); ScenarioContext.Current.Add("templateselected", notificationparams.templateType); notificationpage.enterConditionField(notificationparams.condition); ScenarioContext.Current.Add("conditionfield", notificationparams.condition); // used for validating input data if (notificationparams.enabled == "true") { notificationpage.ClickEnabledCheckbox(); } notificationpage.ClickSaveButton(); }
public void WhenIClickAddANotification() { NotificationPage notificationpage = new NotificationPage(); notificationpage.WaitForThePageToLoad(); notificationpage.ClickTreeDotsButton(); notificationpage.ClickAddButton(); }
public void ThenTheNotificationHasBeenSuccessfullyCreated() { //validate the link is present and clickable NotificationPage notificationspage = new NotificationPage(); notificationspage.WaitForThePageToLoad(); Assert.IsTrue(notificationspage.SuccessMsgDisplayed()); String notification_name = "//a[contains(text(),'" + ScenarioContext.Current["notificationname"] + "')][1]"; Driver.CurrentDriver.FindElement(By.XPath(notification_name)).Click(); System.Threading.Thread.Sleep(5000); // validating all entries are completed as expected on folowing page Assert.IsTrue(Driver.CurrentDriver.FindElement(By.XPath(notificationspage.Checkelement(ScenarioContext.Current["notificationname"].ToString()))).Displayed); Assert.IsTrue(Driver.CurrentDriver.FindElement(By.XPath(notificationspage.Checkelement(ScenarioContext.Current["eventselected"].ToString()))).Displayed); Assert.IsTrue(Driver.CurrentDriver.FindElement(By.XPath(notificationspage.Checkelement(ScenarioContext.Current["templateselected"].ToString()))).Displayed); Assert.IsTrue(Driver.CurrentDriver.FindElement(By.XPath(notificationspage.Checkelement(ScenarioContext.Current["conditionfield"].ToString()))).Displayed); }