public void Showtest() { foreach (var driver in Driver.Current) { AddressPage addressPagecs = new AddressPage(driver); addressPagecs.AddNewAddress(); AddNewAddressPage addNewAddressPage = new AddNewAddressPage(driver); AddressPageModel addressPageModel = new AddressPageModel(); addNewAddressPage.Map.GetElements(); addNewAddressPage.FeedDataToPageForm(addressPageModel); ConfirmationPage confirmationPage = new ConfirmationPage(driver); string id = confirmationPage.GetId().ToString(); confirmationPage.GoToAddressesPage(); addressPagecs.ShowRow(id); Urls urls = new Urls(); Assert.AreEqual(urls._confirmationPage + id, driver.Url); } }
public void AddNewAddresssWithOnlyNecessaryInfo() { foreach (var driver in Driver.Current) { AddressPage addressPagecs = new AddressPage(driver); addressPagecs.AddNewAddress(); AddNewAddressPage addNewAddressPage = new AddNewAddressPage(driver); Dictionary <string, string> newData = new Dictionary <string, string>(); newData.Add("firstname", "john"); newData.Add("lastname", "smith"); newData.Add("address1", "juzna trieda 6"); newData.Add("city", "KE"); newData.Add("zipcode", "04011"); AddressPageModel addressPageModel = new AddressPageModel(); addressPageModel.clearModel(); addressPageModel.CreateData(newData); addNewAddressPage.Map.GetElements(); addNewAddressPage.FeedDataToPageForm(addressPageModel); Urls urls = new Urls(); Assert.AreEqual(urls._confirmationPage + int.Parse(driver.Url.Split('/')[4].ToString()), driver.Url); } }
public void AddNewAddressWithFillingInAllData() { foreach (var driver in Driver.Current) { AddressPage addressPagecs = new AddressPage(driver); addressPagecs.AddNewAddress(); AddNewAddressPage addNewAddressPage = new AddNewAddressPage(driver); AddressPageModel addressPageModel = new AddressPageModel(); addNewAddressPage.Map.GetElements(); addNewAddressPage.FeedDataToPageForm(addressPageModel); Urls urls = new Urls(); Assert.AreEqual(urls._confirmationPage + int.Parse(driver.Url.Split('/')[4].ToString()), driver.Url); } }
public void AddNewAddressWithIncorectData(string key, string value, string expectedUrl) { foreach (var driver in Driver.Current) { AddressPage addressPagecs = new AddressPage(driver); addressPagecs.AddNewAddress(); AddNewAddressPage addNewAddressPage = new AddNewAddressPage(driver); Dictionary <string, string> newData = new Dictionary <string, string>(); newData.Add(key, value); AddressPageModel addressPageModel = new AddressPageModel(); addressPageModel.CreateData(newData); addNewAddressPage.Map.GetElements(); addNewAddressPage.FeedDataToPageForm(addressPageModel); Assert.AreEqual(expectedUrl, driver.Url); } }