Esempio n. 1
0
 /// <summary>
 /// Fills in all the user profile properties for a registered users.
 /// The users country will be set to Belgium, since it will not affect the region field. Other countries will turn the region field into a select list.
 /// </summary>
 /// <param name="photoPath">The path for a photo.</param>
 /// <param name="prefix">The users prefix.</param>
 /// <param name="middle">The users middle name.</param>
 /// <param name="suffix">The users suffix.</param>
 /// <param name="unit">The users unit</param>
 /// <param name="street">The users street address.</param>
 /// <param name="city">The users city.</param>
 /// <param name="region">The users region.</param>
 /// <param name="postalCode">The users postal code.</param>
 /// <param name="telephone">The users telephone number. This will be used for their Telephone, Cell and Fax properties.</param>
 /// <param name="website">The users website.</param>
 /// <param name="IM">The users IM.</param>
 /// <param name="biography">The users biography.</param>
 public void FillInProfileFields(string photoPath, string prefix, string middle, string suffix, string unit, string street, string city, string region, string postalCode, string telephone, string website, string IM, string biography)
 {
     PrefixField.Value     = prefix;
     MiddleNameField.Value = middle;
     SuffixField.Value     = suffix;
     UnitField.Value       = unit;
     StreetField.Value     = street;
     CityField.Value       = city;
     CountrySelectList.SelectByValue("Belgium");
     System.Threading.Thread.Sleep(2500);
     RegionField.Value     = region;
     PostalCodeField.Value = postalCode;
     TelephoneField.Value  = telephone;
     CellPhoneField.Value  = telephone;
     FaxField.Value        = telephone;
     WebsiteField.Value    = website;
     IMField.Value         = IM;
     HTMLEditorModeLink.ClickNoWait();
     System.Threading.Thread.Sleep(1500);
     //Gallio.Framework.TestLog.WriteLine("There are " + IEInstance.Frames.Count + " Frames");
     htmlField.Value = biography;
     System.Threading.Thread.Sleep(1500);
     ProfileUpdateLink.ClickNoWait();
     System.Threading.Thread.Sleep(1500);
     UploadFileLink.ClickNoWait();
     System.Threading.Thread.Sleep(1000);
     FileUpload.Set(photoPath);
     System.Threading.Thread.Sleep(2000);
     SaveFileLink.ClickNoWait();
     System.Threading.Thread.Sleep(3000);
     ProfileUpdateLink.ClickNoWait();
     System.Threading.Thread.Sleep(2000);
 }
        public IViewComponentResult Invoke()
        {
            var countries = countryRepositoryGUI.GetCountries().OrderBy(x => x.Name).Select(x => new { Id = x.Id, Value = x.Name });

            var countryList = new CountrySelectList
            {
                CountryList = new SelectList(countries, "Id", "Value")
            };

            return(View("_CountryList", countryList));
        }
Esempio n. 3
0
 /// <summary>
 /// Adds a new vendor.
 /// Clicks the add new vendor link
 /// Fills in the new vendor field
 /// Clicks the update link
 /// The region field will be set to not required.
 /// </summary>
 /// <param name="vendorName">The company name.</param>
 /// <param name="vendorFName">The vendors first name.</param>
 /// <param name="vendorLname">The vendors last name.</param>
 /// <param name="vendorEmail">The vendors email.</param>
 /// <param name="vendorStreet">The vendors street address.</param>
 /// <param name="vendorCity">The vendors city.</param>
 /// <param name="vendorCountry">The vendors country.</param>
 /// <param name="vendorPostalCode">The vendors postal code.</param>
 /// <param name="vendorPhoneNumber">The vendors phone number. This number will be used for their Telephone, cell phone and fax numbers.</param>
 public void AddNewVendor(string vendorName, string vendorFName, string vendorLname, string vendorEmail, string vendorStreet, string vendorCity, string vendorCountry, string vendorPostalCode, string vendorPhoneNumber)
 {
     AddNewVendorLink.Click();
     CompanyNameField.Value = vendorName;
     FirstNameField.Value   = vendorFName;
     LastNameField.Value    = vendorLname;
     EmailField.Value       = vendorEmail;
     StreetField.Value      = vendorStreet;
     CityField.Value        = vendorCity;
     CountrySelectList.Select(vendorCountry);
     System.Threading.Thread.Sleep(1500);
     RegionRequiredCheckbox.Checked = false;
     System.Threading.Thread.Sleep(1000);
     PostalCodeField.Value = vendorPostalCode;
     TelephoneField.Value  = vendorPhoneNumber;
     CellphoneField.Value  = vendorPhoneNumber;
     FaxField.Value        = vendorPhoneNumber;
     UpdateLink.ClickNoWait();
 }