public void ClickAccessoryCategory(string accessoryCategory) { List <IWebElement> categories = Driver.FindElements(BY_BUILD_CATEGORIES).ToList(); _pageHelpers.FindMatchElementAndClick(categories, accessoryCategory); DriverActions.waitForAjaxRequestToComplete(); }
private IWebElement ClickAddAccessoryByDesc(string accessoryTitle) { bool isFound = false; IWebElement element = null; List <IWebElement> accessoryCards = Driver.FindElements(BY_ACCESSORY_CARD).ToList(); foreach (var accessoryCard in accessoryCards) { string title = accessoryCard.FindElement(BY_ACCESORY_CARD_TITLE).Text; if (stringContainsIgnoreCase(title, accessoryTitle) || stringEqualsIgnoreCase(title, accessoryTitle)) { isFound = true; element = accessoryCard; IWebElement button = accessoryCard.FindElement(BY_ADD_BUTTON); WebElementExtensions.clickElement(button); DriverActions.waitForAjaxRequestToComplete(); break; } } if (!isFound) { Assert.Fail("Accessory with description {0} was not found", accessoryTitle); } return(element); }
public void ClickAccessoryAddByProductName(string productName) { bool isFound = false; List <IWebElement> products = Driver.FindElements(BY_ACCESORIES_PRODUCT).ToList(); foreach (var product in products) { string productLabel = product.Text; if (stringEqualsIgnoreCase(productLabel, productName) || stringContainsIgnoreCase(productLabel, productName)) { isFound = true; IWebElement button = product.FindElement(BY_ACCESSORY_PRODUCT_CTA); DriverActions.ScrollToElement(button); DriverActions.clickElement(button); DriverActions.waitForAjaxRequestToComplete(); break; } } if (!isFound) { throw new NoSuchElementException(string.Format("Product with name {0} was not found for model {1}" , productName, Driver.Url)); } }
public void ClickAccessorySubCategory(string accessoryCategory) { List <IWebElement> subCategoryButtons = Driver.FindElements(BY_SUBCATEGORY_OPTIONS).ToList(); _pageHelpers.FindMatchElementAndClick(subCategoryButtons, accessoryCategory); DriverActions.waitForAjaxRequestToComplete(); }
public void GetToBuildPage() { DriverActions.waitForElementToBeEnabled(BY_FULL_SCREEN_BUTTON); DriverActions.waitForElementToBeEnabled(BY_FLICKITY_SLIDER_BUTTON); DriverActions.waitForAjaxRequestToComplete(); WebDriverExtensions.WaitForPageLoaded(Driver); Assert.IsTrue((Driver.Url).Contains("build")); }
public void ClickAcctLoggedInIcon() { DriverActions.waitForAjaxRequestToComplete(); WebDriverExtensions.WaitForPageLoaded(Driver); DriverActions.WaitForCanvassToComplete(); DriverActions.waitForElementVisibleAndEnabled(BY_ACCT_LOGGED_IN_ICON); DriverActions.clickElement(BY_ACCT_LOGGED_IN_ICON); }
public void ClickRandomSubstepInput() { List<IWebElement> substeps = Driver.FindElements(BY_SUBSTEP_INPUT).ToList(); List<IWebElement> enabledSubsteps = new List<IWebElement>(); foreach (var item in substeps) { if (DriverActions.IsElementPresent(item)) { enabledSubsteps.Add(item); } } int randomInput = rnd.Next(0, enabledSubsteps.Count); DriverActions.clickElement(enabledSubsteps[randomInput]); DriverActions.waitForAjaxRequestToComplete(); }
public void HandlePurposePromptModal() { try { if (DriverActions.IsElementPresent(BY_PURPOSE_PROMPT_MODAL)) { DriverActions.clickElement(BY_ICON_FOR_FUN); DriverActions.waitForAjaxRequestToComplete(); DriverActions.clickElement(BY_PURPOSE_PROMPT_BUILD_BUTTON); DriverActions.waitForAjaxRequestToComplete(); } } catch (Exception) { } }
public void ClickCategoryByName(string categoryName) { bool isFound = false; List <IWebElement> categories = Driver.FindElements(BY_ACCESSORIES_CATEGORIES).ToList(); foreach (var category in categories) { string categoryText = category.FindElement(BY_BUTTON_TAG_NAME).Text; if (stringEqualsIgnoreCase(categoryText, categoryName) || stringContainsIgnoreCase(categoryText, categoryName)) { isFound = true; DriverActions.clickElement(category); DriverActions.waitForAjaxRequestToComplete(); break; } } if (!isFound) { throw new NoSuchElementException(string.Format("Category with name {0} was not found for model {1}" , categoryName, Driver.Url)); } }
public void ClickSubcategoryByName(string subCategoryName) { bool isFound = false; List <IWebElement> subCategories = Driver.FindElements(BY_SUBCATEGORY_TITLE).ToList(); foreach (var subCategory in subCategories) { string subcategoryText = subCategory.Text; if ((subcategoryText.Length != 0) && (stringEqualsIgnoreCase(subcategoryText, subCategoryName) || stringContainsIgnoreCase(subcategoryText, subCategoryName))) { isFound = true; DriverActions.clickElement(subCategory); DriverActions.waitForAjaxRequestToComplete(); break; } } if (!isFound) { throw new NoSuchElementException(string.Format("Sub category with name {0} was not found for model {1}" , subCategoryName, Driver.Url)); } }
public void ClickBuildRestartButton() { DriverActions.clickElement(BY_RESTART_BUILD_BUTTON); DriverActions.waitForAjaxRequestToComplete(); }
public void DeleteSavedVehicle() { DriverActions.clickElement(BY_DELETE_SAVED_BUTTON); DriverActions.waitForAjaxRequestToComplete(); }
public void ClickQuoteCommentsAndEnterText() { ClickQuoteCommentsPlusSign(); DriverActions.waitForAjaxRequestToComplete(); EnterQuoteComments(); }
public void ClickFooterPaymentCalculator() { DriverActions.waitForElementVisibleAndEnabled(BY_FOOTER_PAYMENT_CALC); DriverActions.clickElement(BY_FOOTER_PAYMENT_CALC); DriverActions.waitForAjaxRequestToComplete(); }
public void ClickSummaryNotesTextbox() { DriverActions.clickElement(BY_BUILD_SUMMARY_NOTES); DriverActions.waitForAjaxRequestToComplete(); }
public void ClickMsrpField() { ClickPaymentCalculatorHeader(); DriverActions.clickElement(BY_MSRP_FIELD); DriverActions.waitForAjaxRequestToComplete(); }
public void ClickCalculatorIcon() { DriverActions.clickElement(BY_CALCULATOR_ICON); DriverActions.waitForAjaxRequestToComplete(); }
public void ClickSaveIcon() { DriverActions.clickElement(BY_SAVE_ICON); DriverActions.waitForAjaxRequestToComplete(); }
public void ClickConfirmationContinueButton() { DriverActions.clickElement(BY_CONF_CONTINUE_BUTTON); DriverActions.waitForAjaxRequestToComplete(); WebDriverExtensions.WaitForPageLoaded(Driver); }
public void ClickFirstNameTextBox() { DriverActions.clickElement(BY_FIRST_NAME_FIELD); DriverActions.waitForAjaxRequestToComplete(); }