Пример #1
0
        public void DeleteTestEvent()
        {
            //go to edit page
            GoToUrl(ConfigurationManager.AppSettings["SiteUrl"] + "Event/Edit");

            //select venue from dropdown
            SelectFromDropDown(By.XPath("//select[@id='venueListToSortEvents']"), "Royal Albert Hall");

            //select event from dropdown
            SelectFromDropDown(By.XPath("//select[@id='eventListOnEdit']"), "test event");

            //wait for loaded event on a form
            new WebDriverWait(Driver, TimeSpan.FromSeconds(5)).Until <bool>((d) =>
            {
                var editAreaButton = FindByXPath("//*[contains(@onclick,'GetAreaToEdit')]");
                if (editAreaButton.Displayed)
                {
                    return(true);
                }

                return(false);
            });

            //click delete button
            var deleteButton = FindByXPath("//*[contains(@onclick, 'DeleteEvent')]");

            deleteButton.Click();

            //accept alert
            CustomConditionals.WaitForAlert(Driver);
            Driver.SwitchTo().Alert().Accept();
        }
Пример #2
0
        public void AuthenticatedRefundPurchasedSeat()
        {
            GoToUrl(ConfigurationManager.AppSettings["SiteUrl"] + "Account/PurchaseHistory");
            var refundButtons = FindElementsByXpath("//*[contains(@onclick, 'Refund')]");

            Thread.Sleep(150);
            refundButtons.ToList().ForEach(x =>
            {
                x.Click();
                CustomConditionals.WaitForAlert(Driver);
                Driver.SwitchTo().Alert().Accept();
            });
        }