Exemple #1
0
        public void SelectAllItems()
        {
            DomElement selectAllButtonElement = detailSummary.GetElementWaitByCSS(selectAllButton.locator);

            selectAllButtonElement.webElement.Click();
            detailSummary.GetElementWaitUntil(selectedSpan.locator, (el) => el.Displayed);
        }
Exemple #2
0
        public void NextStep()
        {
            DomElement addressSubmitButton = detailSummary.GetElementWaitUntil(proceedToShippingButton.locator, (el) => el.Enabled);

            try
            {
                addressSubmitButton.webElement.Click();
            }
            catch (System.Exception)
            {
                addressSubmitButton = detailSummary.GetElementWaitUntil(proceedToShippingButton.locator, (el) => el.Enabled);
                addressSubmitButton.webElement.Click();
            }
        }
Exemple #3
0
        public virtual void ProceedToCheckOut()
        {
            DomElement proceedToCheckOutButton = rightNavMenu.GetElementWaitUntil(proceedtoCheckoutbtn.locator,
                                                                                  (el) => el.Displayed);

            //DomElement proceedToCheckOutButton = navRighePanelinCart.GetElementWaitByCSS(proceedtoCheckoutbtn.locator);
            proceedToCheckOutButton.webElement.Click();
        }
Exemple #4
0
        public virtual void PlaceOrderSubmitClick()
        {
            base.ScrollToTop();
            DomElement placeOrderSection      = detailSummary.GetElementWaitByCSS(detailPlaceOrderSection.locator);
            DomElement placeOrderContent      = placeOrderSection.GetElementWaitByCSS(detailPlaceOrderContent.locator);
            DomElement placeOrderSubmitButton = placeOrderContent.GetElementWaitUntil(detailPlaceOrderSubmitButton.locator,
                                                                                      (el) => el.Displayed);

            //Added this try-catch due to randomly fail
            placeOrderSubmitButton.webElement.Click();
        }
Exemple #5
0
        public OrderConfirmationPage PlaceOrderSubmitClick()
        {
            DomElement placeOrderSection      = detailSummary.GetElementWaitByCSS(detailPlaceOrderSection.locator);
            DomElement placeOrderContent      = placeOrderSection.GetElementWaitByCSS(detailPlaceOrderContent.locator);
            DomElement placeOrderSubmitButton = placeOrderContent.GetElementWaitUntil(detailPlaceOrderSubmitButton.locator,
                                                                                      (el) => el.Displayed);

            //Added this try-catch due to randomly fail
            placeOrderSubmitButton.webElement.Click();

            return(new OrderConfirmationPage(Driver));
        }
Exemple #6
0
        public virtual void SetBillingElement(BillingInputs field, string text)
        {
            DomElement billingForm          = detailSummary.GetElementWaitByCSS(detailBillingSection.locator);
            DomElement billingContentIframe = billingForm.GetElementWaitByCSS(detailContentiFrame.locator);
            DomElement formEdit             = billingContentIframe.GetElementWaitByCSS(detailBillingSectionlayoutPanelEdit.locator);

            Thread.Sleep(3000);
            IWebDriver iFrame = Driver.SwitchTo().Frame(FrameName);

            Thread.Sleep(2000);
            detailSummary.GetElementWaitUntil(CenposFrameForm.locator, (el) => el.Displayed);

            switch (field)
            {
            case BillingInputs.CardHolderName:
                IWebElement cardTokenContainerFrameFormCardName = iFrame.FindElement(By.CssSelector(CardNameField.locator));
                SetBillingInput(cardTokenContainerFrameFormCardName, text);
                break;

            case BillingInputs.CardNumber:
                IWebElement cardTokenContainerFrameFormCardNumber = iFrame.FindElement(By.CssSelector(CardNumberField.locator));
                SetBillingInput(cardTokenContainerFrameFormCardNumber, text);
                break;

            case BillingInputs.CVV:
                IWebElement cardTokenContainerFrameFormCardCvv = iFrame.FindElement(By.CssSelector(CardCvvField.locator));
                SetBillingInput(cardTokenContainerFrameFormCardCvv, text);
                break;

            case BillingInputs.ExpirationMonth:
                IWebElement cardTokenContainerFrameFormCardMonth = iFrame.FindElement(By.CssSelector(CardMonthField.locator));
                SetBillingInput(cardTokenContainerFrameFormCardMonth, text);
                break;

            case BillingInputs.ExpirationYear:
                IWebElement cardTokenContainerFrameFormCardYear = iFrame.FindElement(By.CssSelector(CardYearField.locator));
                SetBillingInput(cardTokenContainerFrameFormCardYear, text);
                break;
            }
        }
Exemple #7
0
        public CheckoutPage ProceedToCheckOut()
        {
            DomElement proceedToCheckOutButton = rightNavMenu.GetElementWaitUntil(proceedtoCheckoutbtn.locator,
                                                                                  (el) => el.Displayed);

            //DomElement proceedToCheckOutButton = navRighePanelinCart.GetElementWaitByCSS(proceedtoCheckoutbtn.locator);
            proceedToCheckOutButton.webElement.Click();
            if (Driver.Url.Contains("SignIn"))
            {
                return(null);
            }
            return(new CheckoutPage(Driver));
        }
Exemple #8
0
        public void WaitForAppBusy(int time = 30)
        {
            var busyAnimation = BodyContainer.GetElementWaitUntil(BusyIndicator.locator, webElement =>
            {
                //exit when app busy animation is not displayed
                return(!webElement.Displayed);
            }, time);

            if (busyAnimation == null)
            {
                //throw new Exception($"Busy animation is taking too long. Try increasing the actual wait time: {time}, seconds");
            }
        }
Exemple #9
0
        public virtual void RemoveLinkClick()
        {
            DomElement waitforElement   = detailSummary.GetElementWaitUntil("h2", (el) => !el.Displayed);
            DomElement cartItemsSection = detailSummary.GetElementWaitByCSS(detailCartItems.locator);
            DomElement removeLinkdetail = cartItemsSection.GetElementWaitByCSS(removeLink.locator);

            removeLinkdetail.webElement.Click();
        }
Exemple #10
0
        public void ClickOnContinueShoppingButton(ContinueShoppingButtons field)
        {
            base.WaitForAppBusy();
            detailSummary.GetElementWaitUntil(this.continueShoppingButtons.locator, (el) => el.Displayed);
            List <DomElement> continueShoppingButtons = detailSummary.GetElementsWaitByXpath(this.continueShoppingButtons.locator);

            switch (field)
            {
            case ContinueShoppingButtons.PrintOrderConfirmation:
                continueShoppingButtons[0].webElement.Click();
                break;

            case ContinueShoppingButtons.ContinueShopping:
                continueShoppingButtons[1].webElement.Click();
                break;

            default:
                break;
            }
        }
Exemple #11
0
        public CatalogItemsPage ClickOnNextPage()
        {
            base.ScrollToTop();
            DomElement nextPageArrowElement = catalogSummary.GetElementWaitByCSS(nextPageArrow.locator);

            try
            {
                nextPageArrowElement.webElement.Click();
            }
            catch (Exception)
            {
                nextPageArrowElement = catalogSummary.GetElementWaitByCSS(nextPageArrow.locator);
                nextPageArrowElement.webElement.Click();
            }
            int actualPage = int.Parse(GetActualPageListNumber());

            catalogSummary.GetElementWaitUntil(pageListNumber.locator,
                                               (el) => int.Parse(el.Text) > actualPage);
            return(new CatalogItemsPage(Driver));
        }