Ejemplo n.º 1
0
 public PersonalInfoPage UseParameters()
 {
     FirsNameElement.SendKeys(firstName);
     LastNameElement.SendKeys(lastName);
     SSNElement.SendKeys(ssn);
     return(this);
 }
Ejemplo n.º 2
0
        //Methods

        // Creates a user given a set of details
        public static void CreateUser(string firstname, string lastname, string startdate, string email)
        {
            //Wait for First Name Box
            Helper.WaitForElement(By.XPath("/html/body/div/div/div/form/fieldset/label[1]/input"));
            //Enter First Name
            FirstNameElement.SendKeys(firstname);
            //Enter Last Name
            LastNameElement.SendKeys(lastname);
            //Enter Start Date
            StartDateElement.SendKeys(startdate);
            //Enter Email Address
            EmailElement.SendKeys(email);
            //Click Create Button
            Setup.cDriver.FindElement(AddButton).Click();
        }
Ejemplo n.º 3
0
        // Methods

        // Edits User to hold new values
        public static void UpdateUser(string firstname, string lastname, string startdate, string email)
        {
            //Wait for Email Box
            Helper.WaitForElement(By.CssSelector("body > div > div > div > form > fieldset > label:nth-child(6) > input"));
            //Enter First Name
            FirstNameElement.Clear();
            FirstNameElement.SendKeys(firstname);
            //Enter Last Name
            LastNameElement.Clear();
            LastNameElement.SendKeys(lastname);
            //Enter Start Date
            StartDateElement.Clear();
            StartDateElement.SendKeys(startdate);
            //Enter Email Address
            EmailElement.Clear();
            EmailElement.SendKeys(email);
            //Click update Button
            Setup.cDriver.FindElement(UpdateButton).Click();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the last name.
 /// </summary>
 /// <returns></returns>
 public virtual string GetLastName()
 {
     return(LastNameElement.GetValue <string>());
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Enters the last name.
        /// </summary>
        /// <param name="lastName">The last name.</param>
        /// <returns></returns>
        public virtual _CreateOrUpdateInfoComponent EnterLastName(string lastName)
        {
            LastNameElement.SetValue(lastName);

            return(this);
        }
        /// <summary>
        /// Sets the last name.
        /// </summary>
        /// <param name="lastName">The last name.</param>
        /// <returns></returns>
        public virtual IAddressesCreateOrUpdatePage <T> SetLastName(string lastName)
        {
            LastNameElement.SetValue(lastName);

            return(this);
        }
        /// <summary>
        /// Searches using the search model.
        /// </summary>
        /// <param name="searchModel">The search model.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">searchModel</exception>
        public virtual IListPage Search(CustomerSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            EmailElement.SetValue(searchModel.Email);
            FirstNameElement.SetValue(searchModel.FirstName);
            LastNameElement.SetValue(searchModel.LastName);

            if (searchModel.DateOfBirth.HasValue)
            {
                DateOfBirthMonthElement.SelectByValue(
                    searchModel.DateOfBirth.Value.Month.ToString());

                DateOfBirthDayElement.SelectByValue(
                    searchModel.DateOfBirth.Value.Day.ToString());
            }
            else
            {
                DateOfBirthMonthElement.SelectByIndex(0);
                DateOfBirthDayElement.SelectByIndex(0);
            }

            CompanyElement.SetValue(searchModel.Company);
            IpAddressElement.SetValue(searchModel.IpAddress);

            var currentlySelectedItems = CustomerRoles.GetSelectedOptions();

            if (searchModel.CustomerRoles != null)
            {
                foreach (var opt in currentlySelectedItems)
                {
                    if (!searchModel.CustomerRoles?.Contains(opt) ?? true)
                    {
                        CustomerRoles.DeselectItem(opt);
                    }

                    // Check if there are items that have yet to be selected.
                    if (searchModel.CustomerRoles?.Except(currentlySelectedItems).Any() ?? false)
                    {
                        foreach (var _opt in searchModel.CustomerRoles)
                        {
                            CustomerRoles.SelectItem(_opt);
                        }
                    }
                }
            }

            SearchElement.Click();

            // Wait for the ajax indicator to toggle.
            WrappedDriver
            .Wait(TimeSpan.FromSeconds(10))
            .TrySequentialWait(
                out var exception,
                d => IsAjaxBusy(),
                d => !IsAjaxBusy());

            // Page should reload.
            Load();

            return(this);
        }
        /// <summary>
        /// Sets the last name.
        /// </summary>
        /// <param name="lastName">The last name.</param>
        /// <returns></returns>
        public virtual IInfoPage SetLastName(string lastName)
        {
            LastNameElement.SetValue(lastName);

            return(this);
        }