예제 #1
0
        public virtual void ClickEditAction(EditActions field)
        {
            DomElement stepButton;

            switch (field)
            {
            case EditActions.ContactInformation:
                stepButton = detailSummary.GetElementWaitXpath(
                    $"{checkutStepContainer.locator}[1]//a");
                stepButton.webElement.Click();
                break;

            case EditActions.ShippingInformation:
                stepButton = detailSummary.GetElementWaitXpath(
                    $"{checkutStepContainer.locator}[2]//a");
                stepButton.webElement.Click();
                break;

            case EditActions.SecureBillingInformation:
                stepButton = detailSummary.GetElementWaitXpath(
                    $"{checkutStepContainer.locator}[3]//a");
                stepButton.webElement.Click();
                break;
            }
        }
예제 #2
0
        public void UpdateAmountQuantity()
        {
            Thread.Sleep(3000);
            DomElement amountQuantityElement = offeringSummary.GetElementWaitXpath(
                "//article[@class='mini-cart']/section/div[@class='amount quantity']/span"
                );

            this.amountQuantityCounter = int.Parse(amountQuantityElement.webElement.GetAttribute("innerHTML"));
        }
예제 #3
0
        public CatalogItemsPage ClickOnSubCategory(string subCategoryName)
        {
            DomElement subCategoryElement = catalogSummary.GetElementWaitXpath("//div[contains(text(),'" + subCategoryName + "')]");

            subCategoryElement.webElement.Click();
            return(new CatalogItemsPage(base.Driver));
        }
예제 #4
0
        public virtual void ClickOnBreadCrumbLists()
        {
            base.ScrollToTop();
            base.WaitForAppBusy(8);
            Thread.Sleep(2000);
            DomElement breadcrumbLists = detailSummary.GetElementWaitXpath(this.listsBreadcrumb.locator);

            breadcrumbLists.webElement.Click();
        }
예제 #5
0
        public virtual bool TotalAmountIsCorrect()
        {
            //The Total amount reflects the sum of the items total
            List <DomElement> totalItemPricesElements = detailSummary.GetElementsWaitByXpath(totalItemPrices.locator);
            double            sum = 0;

            foreach (DomElement item in totalItemPricesElements)
            {
                double value = 0;
                double.TryParse(item.webElement.Text, out value);
                sum += value;
            }
            DomElement itemTotalsElement = detailSummary.GetElementWaitXpath(itemsTotals.locator);
            double     itemsTotalsAmount = double.Parse(itemTotalsElement.webElement.Text.Remove(0, 1));

            sum = Math.Round(sum, 2);
            return(sum == itemsTotalsAmount);
        }
예제 #6
0
        public CheckoutPage CheckoutAsGuest()
        {
            DomElement checkoutAsGuestButtonElement = detailSummary.GetElementWaitXpath(checkoutAsGuestButton.locator);

            checkoutAsGuestButtonElement.webElement.Click();
            return(new CheckoutPage(base.Driver));
        }
예제 #7
0
        public virtual void CloseModal()
        {
            DomElement closeModal = detailSummary.GetElementWaitXpath(this.closeModal.locator);

            closeModal.webElement.Click();
        }