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; } }
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")); }
public CatalogItemsPage ClickOnSubCategory(string subCategoryName) { DomElement subCategoryElement = catalogSummary.GetElementWaitXpath("//div[contains(text(),'" + subCategoryName + "')]"); subCategoryElement.webElement.Click(); return(new CatalogItemsPage(base.Driver)); }
public virtual void ClickOnBreadCrumbLists() { base.ScrollToTop(); base.WaitForAppBusy(8); Thread.Sleep(2000); DomElement breadcrumbLists = detailSummary.GetElementWaitXpath(this.listsBreadcrumb.locator); breadcrumbLists.webElement.Click(); }
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); }
public CheckoutPage CheckoutAsGuest() { DomElement checkoutAsGuestButtonElement = detailSummary.GetElementWaitXpath(checkoutAsGuestButton.locator); checkoutAsGuestButtonElement.webElement.Click(); return(new CheckoutPage(base.Driver)); }
public virtual void CloseModal() { DomElement closeModal = detailSummary.GetElementWaitXpath(this.closeModal.locator); closeModal.webElement.Click(); }