Exemple #1
0
        public virtual bool totalsInformationDislayed()
        {
            DomElement detailNavRight        = rightNavigationSection.GetElementWaitByCSS(rightNavProceedToCheckOutButton.locator);
            DomElement detailCheckoutSummary = detailNavRight.GetElementWaitByCSS(checkoutSummary.locator);
            DomElement detailOrderSummary    = detailCheckoutSummary.GetElementWaitByCSS(orderSummarytotals.locator);

            return(detailOrderSummary.webElement.Enabled);
        }
Exemple #2
0
        public void TypeAllPointsNumber(string skunumber)
        {
            DomElement mainQuickOrderPage   = detailSummary.GetElementWaitByCSS(detailQuickOrder.locator);
            DomElement detailProductSection = mainQuickOrderPage.GetElementWaitByCSS(detailProductTextBox.locator);
            DomElement formControlTxtBox    = detailProductSection.GetElementWaitByCSS(detailFormControl.locator);

            formControlTxtBox.webElement.SendKeys(skunumber);
        }
Exemple #3
0
        public virtual void ClickAddtoListButton()
        {
            DomElement modalSection        = detailModal.GetElementWaitByCSS(modalContent.locator);
            DomElement detailmodailContent = modalSection.GetElementWaitByCSS(modalFooter.locator);
            DomElement detailmodalButton   = detailmodailContent.GetElementWaitByCSS(addToListbutton.locator);

            detailmodalButton.webElement.Click();
        }
Exemple #4
0
 public void FilterSetDates(string dateFrom, string dateTo)
 {
     filterDateComponent = filterForm.GetElementWaitByCSS(filterDateComponent.locator);
     filterDateFromInput = filterDateComponent.GetElementWaitByCSS(filterDateFromInput.locator);
     filterDateToInput   = filterDateComponent.GetElementWaitByCSS(filterDateToInput.locator);
     SetInputField(filterDateFromInput, dateFrom);
     SetInputField(filterDateToInput, dateTo);
 }
Exemple #5
0
        public List <string> GetManufacturerMenuOptionsText()
        {
            DomElement searchContainer = SecondarySearchContainer.GetElementWaitByCSS(ProductSearchContainer.locator);
            DomElement select          = searchContainer.GetElementWaitByCSS(ProductSearchContainerManufacturerSelect.locator);

            select.webElement.Click();
            return(select.GetElementsWaitByCSS(ProductSearchContainerManufacturerSelectItem.locator).Select(el => el.webElement.Text).ToList());
        }
Exemple #6
0
        public bool IsSubmitButtonEnabled()
        {
            DomElement formContainer = DetailSection.GetElementWaitByCSS(DetailSectionCardTokenForm.locator);
            DomElement actions       = formContainer.GetElementWaitByCSS(DetailSectionCardTokenFormActions.locator);

            return(formContainer.GetElementWaitByCSS(DetailSectionCardTokenFormActionsSubmit.locator)
                   .webElement.Enabled);
        }
Exemple #7
0
 public void FilterSetSearchOption(string searchOption, string searchValue)
 {
     filterSearchComponent = filterForm.GetElementWaitByCSS(filterSearchComponent.locator);
     filterSearchDropDown  = filterSearchComponent.GetElementWaitByCSS(filterSearchDropDown.locator);
     filterSearchInput     = filterSearchComponent.GetElementWaitByCSS(filterSearchInput.locator);
     SelectDropDownOption(filterSearchDropDown, searchOption);
     SetInputField(filterSearchInput, searchValue);
 }
Exemple #8
0
        public void ClickOnSubmit()
        {
            DomElement formContainer = DetailSection.GetElementWaitByCSS(DetailSectionCardTokenForm.locator);
            DomElement actions       = formContainer.GetElementWaitByCSS(DetailSectionCardTokenFormActions.locator);

            DomElement submitButton = formContainer.GetElementWaitByCSS(DetailSectionCardTokenFormActionsSubmit.locator);

            submitButton.webElement.Click();
        }
Exemple #9
0
        public void SetInputValue(AddressInputs input, string value)
        {
            var addressForm = Container.GetElementWaitByCSS(AddressForm.locator);

            switch (input)
            {
            case AddressInputs.Country:
                var countryInput = addressForm.GetElementWaitByCSS(CountrySelector.locator);
                countryInput.webElement.Click();
                var options = countryInput.GetElementsWaitByCSS(CountryOptionItems.locator);
                var option  = options.FirstOrDefault(el => el.webElement.Text.Contains(value));
                option.webElement.Click();
                break;

            case AddressInputs.CompanyName:
                var companyNameField = addressForm.GetElementWaitByCSS(CompanyNameInput.locator);
                companyNameField.webElement.Clear();
                companyNameField.webElement.SendKeys(value);
                break;

            case AddressInputs.State:
                var stateField = addressForm.GetElementWaitByCSS(stateSelect.locator);
                stateField.webElement.Clear();
                stateField.webElement.SendKeys(value);
                break;

            case AddressInputs.City:
                var cityField = addressForm.GetElementWaitByCSS(cityInput.locator);
                cityField.webElement.Clear();
                cityField.webElement.SendKeys(value);
                break;

            case AddressInputs.Street:
                var streetField = addressForm.GetElementWaitByCSS(streetSelectDropdownlist.locator);
                streetField.webElement.Clear();
                streetField.webElement.SendKeys(value);
                break;

            case AddressInputs.Postal:
                var postalField = addressForm.GetElementWaitByCSS(postalInput.locator);
                postalField.webElement.Clear();
                postalField.webElement.SendKeys(value);
                break;

            case AddressInputs.Apartment:
                var apartmentField = addressForm.GetElementWaitByCSS(aptNumberInput.locator);
                if (!string.IsNullOrEmpty(value))
                {
                    apartmentField.webElement.Clear();
                    apartmentField.webElement.SendKeys(value);
                }
                break;

            default: throw new ArgumentException($"{input} is not supported");
            }
        }
Exemple #10
0
        public void FillCardTokenForm(PaymentOptionModel cardToken)
        {
            string parentWindow = Driver.WindowHandles[0];

            DomElement cardTokenContainer      = DetailSection.GetElementWaitByCSS(DetailSectionCardTokenForm.locator);
            DomElement cardTokenContainerFrame = cardTokenContainer.GetElementWaitByCSS(CenposFrame.locator);

            IWebDriver iFrame = Driver.SwitchTo().Frame(FrameName);

            Helper.FindByCondition(By.CssSelector(CenposFrameForm.locator), (el) => el.Displayed);

            IWebElement cardTokenContainerFrameFormCardNumber = iFrame.FindElement(By.CssSelector(CardNumberField.locator));
            IWebElement cardTokenContainerFrameFormCardMonth  = iFrame.FindElement(By.CssSelector(CardMonthField.locator));
            IWebElement cardTokenContainerFrameFormCardYear   = iFrame.FindElement(By.CssSelector(CardYearField.locator));
            IWebElement cardTokenContainerFrameFormCardName   = iFrame.FindElement(By.CssSelector(CardNameField.locator));
            IWebElement cardTokenContainerFrameFormCardCvv    = iFrame.FindElement(By.CssSelector(CardCvvField.locator));

            cardTokenContainerFrameFormCardNumber.SendKeys(cardToken.CardNumber);
            cardTokenContainerFrameFormCardMonth.SendKeys(cardToken.ExpirationMont);
            cardTokenContainerFrameFormCardYear.SendKeys(cardToken.ExpirationYear);
            cardTokenContainerFrameFormCardName.SendKeys(cardToken.HolderName);
            cardTokenContainerFrameFormCardCvv.SendKeys(cardToken.Cvv);

            Driver.SwitchTo().Window(parentWindow);
        }
Exemple #11
0
        public PaymentOptionsHomePage ClickOnCancel()
        {
            DomElement formContainer = DetailSection.GetElementWaitByCSS(DetailSectionCardTokenForm.locator);
            DomElement actions       = formContainer.GetElementWaitByCSS(DetailSectionCardTokenFormActions.locator);

            DomElement cancelButton = formContainer.GetElementWaitByCSS(DetailSectionCardTokenFormActionsCancel.locator);

            cancelButton.webElement.Click();

            return(new PaymentOptionsHomePage(Driver));
        }
Exemple #12
0
        public virtual void SelectFirstInBillingDropDown()
        {
            DomElement billingForm     = detailSummary.GetElementWaitByCSS(detailBillingSection.locator);
            DomElement billingDropDown = billingForm.GetElementWaitByCSS(detailBillingEditFormInputExistingDropdown.locator);

            billingDropDown.webElement.Click();
            DomElement        billingOnlyDropdown = billingForm.GetElementWaitByCSS(detailBillingEditFormInputExistingDropdownOnly.locator);
            List <DomElement> dropdownOptions     = billingOnlyDropdown.GetElementsWaitByCSS(detailBillingEditFormInputExistingDropdownOption.locator);

            dropdownOptions.FirstOrDefault().webElement.Click();
        }
Exemple #13
0
        public OfferingProductsPage ClickOnFirstItemInCatalog()
        {
            DomElement catalogPageView = catalogSummary.GetElementWaitByCSS(detailGridItemContent.locator);
            DomElement itemImageView   = catalogPageView.GetElementWaitByCSS(detailItemImage.locator);

            itemImageView.webElement.Click();
            return(new OfferingProductsPage(Driver));
        }
Exemple #14
0
        public virtual void SetLoginCredentials(LoginCredential loginCredentials)
        {
            DomElement signInPageContainer = BodyContainer.GetElementWaitByCSS(SignInSectionContainer.locator);
            DomElement loginContainer      = signInPageContainer.GetElementWaitByCSS(LoginContainer.locator);
            DomElement emailField          = loginContainer.GetElementWaitByCSS(EmailInput.locator);
            DomElement passwordField       = loginContainer.GetElementWaitByCSS(PasswordInput.locator);

            emailField.webElement.SendKeys(loginCredentials.User);
            passwordField.webElement.SendKeys(loginCredentials.Password);
            //TODO:
            //use a selenium wait to replace this Sleep
            System.Threading.Thread.Sleep(1900);
        }
Exemple #15
0
        public virtual bool DefaultTitlePage()
        {
            DomElement listDetailSummary = detailSummary.GetElementWaitByCSS(detailSection.locator);
            DomElement listDetailSection = listDetailSummary.GetElementWaitByCSS(detaulfTitleList.locator);

            return(listDetailSection.webElement.Enabled);
        }
Exemple #16
0
        public string GetCoBrandSectionText(IndexHomePageSectionsEnum section)
        {
            DomElement mainContainer = BodyContainer.GetElementWaitByCSS(MainContainer.locator);

            switch (section)
            {
            case IndexHomePageSectionsEnum.Top:
                return(mainContainer.GetElementWaitByCSS(TopZoneContainer.locator).webElement.Text);

            case IndexHomePageSectionsEnum.Bottom:
                return(mainContainer.GetElementWaitByCSS(BottomZoneContainer.locator).webElement.Text);

            default: throw new ArgumentException($"{section} is not supported yet..");
            }
        }
Exemple #17
0
        public bool SpecificationsSection()
        {
            DomElement offeringProductSection   = offeringSummary.GetElementWaitByCSS(productSection.locator);
            DomElement sectionShippingAvailable = offeringProductSection.GetElementWaitByCSS(detailSpecifications.locator);

            return(sectionShippingAvailable.webElement.Enabled);
        }
Exemple #18
0
        public bool ShippingInfoSectionAvailable()
        {
            DomElement offeringProductSection   = offeringSummary.GetElementWaitByCSS(productSection.locator);
            DomElement sectionShippingAvailable = offeringProductSection.GetElementWaitByCSS(detailshippingavailable.locator);

            return(sectionShippingAvailable.webElement.Enabled);
        }
Exemple #19
0
        public void AddtoCartInOffering()
        {
            DomElement offeringProductSection = offeringSummary.GetElementWaitByCSS(productSection.locator);
            DomElement buttonaddtocart        = offeringProductSection.GetElementWaitByCSS(detailaddbutton.locator);

            buttonaddtocart.webElement.Click();
        }
Exemple #20
0
        public bool SavingsMsgDisplayed()
        {
            DomElement offeringProductSection = offeringSummary.GetElementWaitByCSS(productSection.locator);
            DomElement savingmessagedisplayed = offeringProductSection.GetElementWaitByCSS(savingsmsglabel.locator);

            return(savingmessagedisplayed.webElement.Enabled);
        }
Exemple #21
0
        public bool YourPriceLabelforAUTH()
        {
            DomElement offeringProductSection    = offeringSummary.GetElementWaitByCSS(productSection.locator);
            DomElement yourpriceLabeltextforAUTH = offeringProductSection.GetElementWaitByCSS(detailYourPriceLabel.locator);

            return(yourpriceLabeltextforAUTH.webElement.Enabled);
        }
Exemple #22
0
        public bool ContactInfoExist()
        {
            DomElement dashboardContainer = Container.GetElementWaitByCSS(Subcontainer.locator);
            DomElement contactInfoSection = dashboardContainer.GetElementWaitByCSS(ContactInfoSection.locator);

            return(contactInfoSection.webElement.Displayed && contactInfoSection.webElement.Enabled);
        }
Exemple #23
0
        public void SelectPreviouslyStoreAddress(string address)
        {
            DomElement formContainer = DetailSection.GetElementWaitByCSS(DetailSectionCardTokenForm.locator);
            DomElement prevStoredAddressesDropdown = formContainer.GetElementWaitByCSS(DetailSectionCardTokenFormItemSelection.locator);

            SelectDropDownAutoCompleteOption(prevStoredAddressesDropdown, address);
        }
Exemple #24
0
        //public bool ClickContactInfoLink()
        //{
        //    this.linkContactInfo.webElement = _helper.GetElementWait(this.linkContactInfo.findsBy);
        //    linkContactInfo.webElement.Click();
        //    return true;
        //}

        public bool AddressesExist()
        {
            DomElement dashboardContainer = Container.GetElementWaitByCSS(Subcontainer.locator);
            DomElement addressesSection   = dashboardContainer.GetElementWaitByCSS(AddressesSection.locator);

            return(addressesSection.webElement.Displayed && addressesSection.webElement.Enabled);
        }
Exemple #25
0
        //public string GetNoRecentOrdersMessage() => this.WebElementGetText(this.MessageNotRecentOrders.findsBy);

        public bool DashboardTitleExist()
        {
            DomElement dashboardContainer = Container.GetElementWaitByCSS(Subcontainer.locator);
            DomElement title = dashboardContainer.GetElementWaitByCSS(PageTitle.locator);

            return(title.webElement.Displayed && title.webElement.Enabled);
        }
Exemple #26
0
        public bool RecentOrdersExist()
        {
            DomElement dashboardContainer  = Container.GetElementWaitByCSS(Subcontainer.locator);
            DomElement recentOrdersSection = dashboardContainer.GetElementWaitByCSS(RecentOrdersSection.locator);

            return(recentOrdersSection.webElement.Displayed && recentOrdersSection.webElement.Enabled);
        }
Exemple #27
0
        public void ClickOnMakeDefault()
        {
            DomElement cardTokenContainer = DetailSection.GetElementWaitByCSS(DetailSectionCardTokenForm.locator);
            DomElement cardTokenCheckbox  = cardTokenContainer.GetElementWaitByCSS(DetailSectionCardTokenFormCheckbox.locator);

            cardTokenCheckbox.webElement.Click();
        }
Exemple #28
0
        public string GetPhoneNumber()
        {
            DomElement contactSection = Container.GetElementWaitByCSS(ContainerContact.locator);
            DomElement phoneNumber    = contactSection.GetElementWaitByCSS(ContactPhoneNumber.locator);

            return(phoneNumber.webElement.Text);
        }
Exemple #29
0
        //public bool AreNotRecentOrders()
        //{
        //    this.messageNotRecentOrders.webElement = _helper.GetElementWait(this.messageNotRecentOrders.findsBy);

        //    return this.messageNotRecentOrders.webElement.Displayed && this.messageNotRecentOrders.webElement.Enabled;
        //}

        //internal bool ClickOrderDetail()
        //{
        //    var orderTable = recentOrdersSection.GetElementsWaitByCSS("table tbody").FirstOrDefault();
        //    if (orderTable == null)
        //    {
        //        return false;
        //    }
        //    var tableRows = orderTable.GetElementsWaitByCSS("tr");
        //    if (tableRows.Count > 0)
        //    {
        //        var ancor = orderTable.GetElementsWaitByCSS("a").FirstOrDefault();
        //        if (ancor != null)
        //        {
        //            ancor.webElement.Click();
        //            return true;
        //        }
        //    }
        //    return true;
        //}


        public bool PaymentOptionsExist()
        {
            DomElement dashboardContainer    = Container.GetElementWaitByCSS(Subcontainer.locator);
            DomElement paymentOptionsSection = dashboardContainer.GetElementWaitByCSS(PaymentOptionsSection.locator);

            return(paymentOptionsSection.webElement.Displayed && paymentOptionsSection.webElement.Enabled);
        }
Exemple #30
0
        public bool ListPriceLabelforANON()
        {
            DomElement offeringProductSection    = offeringSummary.GetElementWaitByCSS(productSection.locator);
            DomElement listpriceLabeltextforANON = offeringProductSection.GetElementWaitByCSS(detailListPriceLabel.locator);

            return(listpriceLabeltextforANON.webElement.Enabled);
        }