コード例 #1
0
ファイル: EventsSteps.cs プロジェクト: srgleason/uat-kit
        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);
            }
        }