public 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); }
private DomElement GetLastPageElementButton() { List <DomElement> paginationButtonsElements = catalogSummary.GetElementsWaitByXpath(paginationButtons.locator); DomElement majorPageIndexElement = null; int majorIndex = 0; foreach (var element in paginationButtonsElements) { int number; int.TryParse(element.webElement.Text, out number); if (number > majorIndex) { majorIndex = number; majorPageIndexElement = element; } } return(majorPageIndexElement); }
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; } }