public void WhenIAddARegistrationOptionToEvent(string eventName, Table registrationOptions) { eventName += uniqueStamp; GetEventPanel(eventName); foreach (var option in registrationOptions.Rows) { EventPanel.AddRegistrationOption(option); } }
public void WhenIAddARegistrationOptionToEvent(string eventName, Table registrationOptions) { try { eventName += uniqueStamp; // the unique stamp is a series of numbers to keep names different from each other GetEventPanel(eventName); // open event panel foreach (var option in registrationOptions.Rows) { EventPanel.AddRegistrationOption(option); //add a registration option } } catch (Exception ex) { throw new Exception("Error: could not add a registration option. " + ex.Message); } }
public void WhenIAddRegistrationOptionsToEvent(string eventName, Table registrationOptions) { try { foreach (var option in registrationOptions.Rows) { if (!EventPanel.RegistrationOptionExists(option)) { EventPanel.AddRegistrationOption(option); //add a registration option } } } catch (Exception ex) { throw new Exception("Error: could not add a registration option. " + ex.Message); } }
public void GivenEventExistsWithRegistrationOption(string eventName, string StartDate, Table options) { DateTime actualStartDate = StepHelper.SetTodayDateForVariable(StartDate); eventName += uniqueStamp; //navigate to event and add event BBCRMHomePage.OpenEventsFA(); try { Panel.WaitClick(XpathHelper.xPath.VisiblePanel + "//button[./text()='Add new']", 15); Panel.WaitClick("//span[./text()='Event']", 15); } catch { try { BaseComponent.GetEnabledElement("//span[contains(.,'Cannot read property')]", 5); Dialog.OK(); } catch { } Panel.WaitClick(XpathHelper.xPath.VisiblePanel + "//button[./text()='Add new']", 15); Panel.WaitClick("//span[./text()='Event']", 15); } //check is visible BaseComponent.GetEnabledElement(XpathHelper.xPath.VisibleBlock + "//span[text()='Add an event']"); //set fields Dialog.SetTextField("//input[contains(@id,'_STARTDATE_value')]", actualStartDate.ToShortDateString()); Dialog.SetTextField("//input[contains(@id,'_NAME_value')]", eventName); Dialog.SetTextField("//input[contains(@id,'_EVENTCATEGORYCODEID_value')]", "Sport"); StepHelper.AddEntryOnTheFly(); Dialog.Save(); foreach (var option in options.Rows) { EventPanel.AddRegistrationOption(option); } }