public void DesignateUserAddressAsDefault() { var testUser = DataFactory.Users.CreateTestUser(); AddressModel testData = new AddressModel { country = "US", street = "elm street", city = "elm city", CompanyName = "KDA", postal = "22800", state = "CO" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); Assert.IsNotNull(indexPage, "login failed"); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesHome.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesHome = createAddressPage.ClickOnSubmit(); addressesHome.InformationModal.ClickOnClose(); addressesHome.ClickOnAddressInDropdown(AccessLevel.User, testData); addressesHome.ContentModal.ClickOnMakeDefault(); //TODO //check if busy is present addressesHome.WaitForAppBusy(); addressesHome.InformationModal.ClickOnClose(); bool defaultLabelExist = addressesHome.IsDefaultLabelPresentOnDropdownItem(AccessLevel.User); string actualDefaultAddress = addressesHome.GetDefaultTileAddressData(AccessLevel.User); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testData.street)); Assert.IsTrue(actualDefaultAddress.Contains(testData.country)); Assert.IsTrue(actualDefaultAddress.Contains(testData.postal)); Assert.IsTrue(actualDefaultAddress.Contains(testData.state)); bool accountTileExist = addressesHome.DefaultTileExist(AccessLevel.Account); Assert.IsFalse(accountTileExist, "default account level tile is already present"); }
public void AddUserLevelAddressAutocompleteEdited() { var testUser = TestDataFactory.CreateLoginAccount(); AddressModel testAddress = new AddressModel { apartment = "07", city = "Denver", country = "US", postal = "12345", state = "CO", street = "Walnut Street", CompanyName = "QA Softtek" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Email, testUser.Password); Assert.IsNotNull(indexPage, "login failed"); AddressesHomePage addressesHomePage = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressesPage = addressesHomePage.ClickOnAddNewAddress(); //fill address form createAddressesPage.SetInputValue(AddressInputs.CompanyName, testAddress.CompanyName); createAddressesPage.SetStreetAutoComplete(testAddress.street, testAddress.city, testAddress.state, testAddress.country); createAddressesPage.SetInputValue(AddressInputs.Apartment, testAddress.apartment); createAddressesPage.SetInputValue(AddressInputs.City, testAddress.city); createAddressesPage.SetInputValue(AddressInputs.Postal, testAddress.postal); bool submitButtonEnabled = createAddressesPage.AddNewButtonIsEnabled(); Assert.IsTrue(submitButtonEnabled, "Submit button is not enabled"); addressesHomePage = createAddressesPage.ClickOnSubmit(); addressesHomePage.WaitForAppBusy(); addressesHomePage.InformationModal.ClickOnClose(); addressesHomePage.WaitForAppBusy(); var dropdownItems = addressesHomePage.GetAddressesDropdownItems(AccessLevel.User).ToList(); //just created address data string createdAddress = FormatAddress(testAddress); //search the address in the user level dropdown string expectedAddress = dropdownItems.FirstOrDefault(x => x.Contains(createdAddress)); Assert.IsNotNull(expectedAddress, "Address is not found in dropdown"); }
public void AddIntlAddressSetAsDefault() { var testUser = TestDataFactory.CreateLoginAccount(); AddressModel testAddress = new AddressModel { country = "MX", CompanyName = "intl address ;)", street = "calle sexta", state = "Estado de Baja California", city = "Ensenada", postal = "22790", apartment = "12" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Email, testUser.Password); AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses(); AddAddressPage addAddressPage = addressesPage.ClickOnAddNewAddress(); string expectedCountry = addAddressPage.GetCurrentCountryValue(); var currentCountries = addAddressPage.GetCountriesFromDropdown().ToList(); addAddressPage.SetInputValue(AddressInputs.Country, testAddress.country); addAddressPage.SetInputValue(AddressInputs.CompanyName, testAddress.CompanyName); addAddressPage.SetInputValue(AddressInputs.State, testAddress.state); addAddressPage.SetInputValue(AddressInputs.Street, testAddress.street); addAddressPage.SetInputValue(AddressInputs.City, testAddress.city); addAddressPage.SetInputValue(AddressInputs.Postal, testAddress.postal); addAddressPage.SetInputValue(AddressInputs.Apartment, testAddress.apartment); addAddressPage.SetCheckboxDefault(); addressesPage = addAddressPage.ClickOnSubmit(); addressesPage.WaitForAppBusy(); addressesPage.InformationModal.ClickOnClose(); addressesPage.WaitForAppBusy(); Thread.Sleep(1000); var dropdownItems = addressesPage.GetAddressesDropdownItems(AccessLevel.User).ToList(); bool defaultLabelExist = addressesPage.IsDefaultLabelPresentOnDropdownItem(AccessLevel.User); string actualDefaultAddress = addressesPage.GetDefaultTileAddressData(AccessLevel.User); //just created address data string createdAddress = FormatAddress(testAddress); string expectedAddress = dropdownItems.FirstOrDefault(x => x.Contains(createdAddress)); bool userLevelTileExist = addressesPage.DefaultTileExist(AccessLevel.User); Assert.IsNotNull(expectedAddress, "The just added address is not found on the dropdown"); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.street)); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.apartment)); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.country)); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.postal)); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.state)); Assert.IsTrue(userLevelTileExist, "default user level tile is already present"); }
public void EditDefaultUserLevelAddress() { var testUser = TestDataFactory.CreateLoginAccount(); AddressModel testData = new AddressModel { CompanyName = "QA Softtek", street = "Street A", apartment = "07", state = "CO", city = "Denver", country = "US", postal = "12345" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Email, testUser.Password); Assert.IsNotNull(indexPage, "Login failed"); AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesPage.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testData.apartment); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesPage = createAddressPage.ClickOnSubmit(); addressesPage.WaitForAppBusy(); addressesPage.InformationModal.ClickOnClose(); addressesPage.WaitForAppBusy(); //Start updating the address addressesPage.ClickOnAddressInDropdown(AccessLevel.User, testData); EditAddressPage editAddressPage = addressesPage.ContentModal.ClickOnEdit(); editAddressPage.SetCheckboxDefault(); addressesPage = editAddressPage.ClickOnSubmit(); addressesPage.WaitForAppBusy(); Thread.Sleep(1000); bool defaultLabelExist = addressesPage.IsDefaultLabelPresentOnDropdownItem(AccessLevel.User); string actualDefaultAddress = addressesPage.GetDefaultTileAddressData(AccessLevel.User); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testData.street)); Assert.IsTrue(actualDefaultAddress.Contains(testData.apartment)); Assert.IsTrue(actualDefaultAddress.Contains(testData.country)); Assert.IsTrue(actualDefaultAddress.Contains(testData.postal)); Assert.IsTrue(actualDefaultAddress.Contains(testData.state)); //addressesPage.Header.ClickOnSignOut(); }
public void DeleteAddressCase() { var testUser = TestDataFactory.CreateLoginAccount(); AddressModel testData = new AddressModel { CompanyName = "QA Softtek", street = "Walnut Street", apartment = "07", state = "CO", city = "Denver", country = "US", postal = "12345" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Email, testUser.Password); Assert.IsNotNull(indexPage, "Login failed"); AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesPage.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testData.apartment); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesPage = createAddressPage.ClickOnSubmit(); addressesPage.WaitForAppBusy(); addressesPage.InformationModal.ClickOnClose(); addressesPage.WaitForAppBusy(); Thread.Sleep(1000); //delete address addressesPage.ClickOnAddressInDropdown(AccessLevel.User, testData); addressesPage.WaitForAppBusy(); addressesPage.ContentModal.ClickOnDelete(); addressesPage.ConfirmationModal.ClickOnDelete(); addressesPage.WaitForAppBusy(); var dropdownItems = addressesPage.GetAddressesDropdownItems(AccessLevel.User).ToList(); //deleted address data string deletedAddress = FormatAddress(testData); //search the address in the user level dropdown string expectedAddress = dropdownItems.FirstOrDefault(x => x.Contains(deletedAddress)); Assert.IsNull(expectedAddress, "Selected address is still in the dropdown o:"); }
public void DeleteAddressThatIsDefault() { var testUser = DataFactory.Users.CreateTestUser(); AddressModel testData = new AddressModel { CompanyName = "QA Automation Softtek", street = "test street", apartment = "07", state = "CO", city = "Denver", country = "US", postal = "12345" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); Assert.IsNotNull(indexPage, "Login failed"); AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesPage.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testData.apartment); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); createAddressPage.SetCheckboxDefault(); addressesPage = createAddressPage.ClickOnSubmit(); addressesPage.InformationModal.ClickOnClose(); //TODO //does not find any address in dropdown System.Threading.Thread.Sleep(1000); addressesPage.ClickOnAddressInDropdown(AccessLevel.User, testData); addressesPage.ContentModal.ClickOnDelete(); //validating that only exist 1 modal bool confirmationModalExist = addressesPage.ConfirmationModalExist(); Assert.IsFalse(confirmationModalExist, "This element should not exist"); }
public void EditIntlAddressSetAsDefault() { var testUser = DataFactory.Users.CreateTestUser(); AddressModel testData = new AddressModel { CompanyName = "QA Softtek", street = "Walnut street", apartment = "07", state = "CO", city = "Denver", country = "US", postal = "12345" }; AddressModel newAddress = new AddressModel { street = "Calle novena", apartment = "apt 2", state = "estado de baja california", city = "ensenada", country = "MX", postal = "22780", }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesHome.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testData.apartment); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesHome = createAddressPage.ClickOnSubmit(); addressesHome.InformationModal.ClickOnClose(); //start to update the address addressesHome.ClickOnAddressInDropdown(AccessLevel.User, testData); EditAddressPage editAddressPage = addressesHome.ContentModal.ClickOnEdit(); editAddressPage.SetInputValue(AddressInputs.Country, newAddress.country); editAddressPage.SetInputValue(AddressInputs.State, newAddress.state); editAddressPage.SetInputValue(AddressInputs.Street, newAddress.street); editAddressPage.SetInputValue(AddressInputs.City, newAddress.city); editAddressPage.SetInputValue(AddressInputs.Apartment, newAddress.apartment); editAddressPage.SetInputValue(AddressInputs.Postal, newAddress.postal); editAddressPage.SetCheckboxDefault(); addressesHome = editAddressPage.ClickOnSubmit(); //TODO addressesHome.WaitForAppBusy(); var dropdownItems = addressesHome.GetAddressesDropdownItems(AccessLevel.User).ToList(); //just edited address data string expectedAddress = "Default " + FormatAddress(newAddress); string actualAddress = dropdownItems.FirstOrDefault(); //search the address in the user level dropdown Assert.AreEqual(expectedAddress, actualAddress); }
public void EditInternationalAddress() { var testUser = DataFactory.Users.CreateTestUser(); AddressModel testData = new AddressModel { CompanyName = "QA Softtek", street = "Walnut street", apartment = "07", state = "CO", city = "Denver", country = "US", postal = "12345" }; var newAddress = new AddressModel { street = "Calle septima", apartment = "suite 12", state = "estado de baja california", city = "ensenada", country = "MX", postal = "22890", }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesHome.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testData.apartment); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesHome = createAddressPage.ClickOnSubmit(); addressesHome.InformationModal.ClickOnClose(); //start updating the address addressesHome.ClickOnAddressInDropdown(AccessLevel.User, testData); EditAddressPage editAddressPage = addressesHome.ContentModal.ClickOnEdit(); editAddressPage.SetInputValue(AddressInputs.Country, newAddress.country); editAddressPage.SetInputValue(AddressInputs.State, newAddress.state); editAddressPage.SetInputValue(AddressInputs.Street, newAddress.street); editAddressPage.SetInputValue(AddressInputs.City, newAddress.city); editAddressPage.SetInputValue(AddressInputs.Apartment, newAddress.apartment); editAddressPage.SetInputValue(AddressInputs.Postal, newAddress.postal); addressesHome = editAddressPage.ClickOnSubmit(); System.Threading.Thread.Sleep(1500); var dropdownItems = addressesHome.GetAddressesDropdownItems(AccessLevel.User).ToList(); //just edited address data string createdAddress = FormatAddress(newAddress); //search the address in the user level dropdown string expectedAddress = dropdownItems.FirstOrDefault(x => x.Contains(createdAddress)); Assert.IsNotNull(expectedAddress, "Address is not found in dropdown"); }
public void EditUserLevelAddress() { var testUser = DataFactory.Users.CreateTestUser(); AddressModel testData = new AddressModel { CompanyName = "QA Softtek", street = "Walnut street", apartment = "07", state = "CO", city = "Denver", country = "US", postal = "12345" }; AddressModel newAddress = new AddressModel { street = "Elm street", apartment = "apt 123", state = "CO", city = "Denver", country = "US", postal = "12345", }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesHome.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testData.apartment); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesHome = createAddressPage.ClickOnSubmit(); addressesHome.InformationModal.ClickOnClose(); //Start updating the address addressesHome.ClickOnAddressInDropdown(AccessLevel.User, testData); EditAddressPage editAddressPage = addressesHome.ContentModal.ClickOnEdit(); editAddressPage.SetInputValue(AddressInputs.Street, newAddress.street); editAddressPage.SetInputValue(AddressInputs.Apartment, newAddress.apartment); addressesHome = editAddressPage.ClickOnSubmit(); //TODO //check if an animation is present addressesHome.WaitForAppBusy(); //TODO //dropdown is not populated System.Threading.Thread.Sleep(1500); var dropdownItems = addressesHome.GetAddressesDropdownItems(AccessLevel.User).ToList(); //just edited address data string expectedAddress = FormatAddress(newAddress); //search the address in the user level dropdown string actualAddress = dropdownItems.FirstOrDefault(); Assert.AreEqual(expectedAddress, actualAddress); }
public void AddInternationalAddress() { var testUser = DataFactory.Users.CreateTestUser(); AddressModel testAddress = new AddressModel { country = "MX", CompanyName = "intl address ;)", street = "calle sexta", state = "Estado de Baja California", city = "Ensenada", postal = "22790", apartment = "12" }; string defaultCountry = "US - United States"; var nonAceptedCountries = new { Somalia = "Somalia", Cuba = "Cuba", Iran = "Iran", NorthKorea = "North Korea", Lebannon = "Lebannon", Syria = "Syria" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses(); AddAddressPage addAddressPage = addressesPage.ClickOnAddNewAddress(); string expectedCountry = addAddressPage.GetCurrentCountryValue(); var currentCountries = addAddressPage.GetCountriesFromDropdown().ToList(); addAddressPage.SetInputValue(AddressInputs.Country, testAddress.country); addAddressPage.SetInputValue(AddressInputs.CompanyName, testAddress.CompanyName); addAddressPage.SetInputValue(AddressInputs.State, testAddress.state); addAddressPage.SetInputValue(AddressInputs.Street, testAddress.street); addAddressPage.SetInputValue(AddressInputs.City, testAddress.city); addAddressPage.SetInputValue(AddressInputs.Postal, testAddress.postal); addAddressPage.SetInputValue(AddressInputs.Apartment, testAddress.apartment); addressesPage = addAddressPage.ClickOnSubmit(); addressesPage.InformationModal.ClickOnClose(); var dropdownItems = addressesPage.GetAddressesDropdownItems(AccessLevel.User).ToList(); //just created address data string createdAddress = FormatAddress(testAddress); string expectedAddress = dropdownItems.FirstOrDefault(x => x.Contains(createdAddress)); Assert.IsTrue(defaultCountry.Contains(expectedCountry), $"'{expectedCountry}' is not the default country"); CollectionAssert.DoesNotContain(currentCountries, nonAceptedCountries.Cuba, $"'{nonAceptedCountries.Cuba}' cannot be here"); CollectionAssert.DoesNotContain(currentCountries, nonAceptedCountries.Iran, $"'{nonAceptedCountries.Iran}' cannot be here"); CollectionAssert.DoesNotContain(currentCountries, nonAceptedCountries.Lebannon, $"'{nonAceptedCountries.Lebannon}' cannot be here"); CollectionAssert.DoesNotContain(currentCountries, nonAceptedCountries.NorthKorea, $"'{nonAceptedCountries.NorthKorea}' cannot be here"); CollectionAssert.DoesNotContain(currentCountries, nonAceptedCountries.Somalia, $"'{nonAceptedCountries.Somalia}' cannot be here"); CollectionAssert.DoesNotContain(currentCountries, nonAceptedCountries.Syria, $"'{nonAceptedCountries.Syria}' cannot be here"); Assert.IsNotNull(expectedAddress, "The just added address is not found on the dropdown"); }
//Test Case on test rail -> C1134, C1135, C1179 //[TestMethod] //[TestCategory(TestCategoriesConstants.Regression)] //[TestCategory(TestCategoriesConstants.Smoke)] public void AddCreditCardUsingPrevStoredAddress() { var testData = TestDataFactory.CreateLoginAccount(); AddressModel testAddress = new AddressModel { country = "US", street = "street test", CompanyName = "address company name", state = "CO", city = "boulder", postal = "52809" }; PaymentOptionModel testCardtoken = new PaymentOptionModel { CardNumber = "4111111111111111", ExpirationMont = "12", ExpirationYear = "22", HolderName = "Test holder", Cvv = "077", LastFourDigits = "1111" }; IndexPage indexPage = new IndexPage(driver, url); LoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testData.Email, testData.Password); //Manually add an address AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesPage.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testAddress.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testAddress.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testAddress.apartment); createAddressPage.SetInputValue(AddressInputs.City, testAddress.city); createAddressPage.SetInputValue(AddressInputs.State, testAddress.state); createAddressPage.SetInputValue(AddressInputs.Postal, testAddress.postal); addressesPage = createAddressPage.ClickOnSubmit(); addressesPage.IsAppBusy(); //TODO: check the logic on address create process addressesPage.IsAppBusy(); addressesPage.InformationModal.ClickOnClose(); //test begins here PaymentOptionsHomePage paymentsPage = addressesPage.Header.ClickOnPaymentOptions(); PaymentOptionsCreatePage addNewPaymentPage = paymentsPage.ClickOnAddNewCreditCard(); string storedAddress = string.IsNullOrEmpty(testAddress.apartment) ? $"{testAddress.street}, {testAddress.city} {testAddress.country} {testAddress.postal}" : $"{testAddress.street}, {testAddress.apartment}, {testAddress.city} {testAddress.country} {testAddress.postal}"; addNewPaymentPage.FillCardTokenForm(testCardtoken); addNewPaymentPage.SelectBillingAddressOption(BillingAddressOptionsEnum.Stored); addNewPaymentPage.SelectPreviouslyStoreAddress(storedAddress); addNewPaymentPage.ClickOnSubmit(); addNewPaymentPage.IsAppBusy(); paymentsPage = addNewPaymentPage.CloseModal(ModalsEnum.Information); addNewPaymentPage.IsAppBusy(); Thread.Sleep(500); List <string> items = paymentsPage.GetPaymentsDropdownItems(AccessLevel.User).ToList(); string payment = items.FirstOrDefault(it => it.Contains($"{testCardtoken.LastFourDigits} {testCardtoken.ExpirationMont}/{testCardtoken.ExpirationYear}")); Assert.IsNotNull(payment, "Payment option is not found"); }
public void EditIntlAddressSetAsDefault() { var testUser = TestDataFactory.CreateLoginAccount(); AddressModel testData = new AddressModel { CompanyName = "QA Softtek", street = "Walnut Street", apartment = "07", state = "CO", city = "Denver", country = "US", postal = "12345" }; AddressModel newAddress = new AddressModel { street = "Calle novena", apartment = "suite 2", state = "estado de baja california", city = "ensenada", country = "MX", postal = "22790", }; IndexPage indexPage = new IndexPage(driver, url); LoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Email, testUser.Password); Assert.IsNotNull(indexPage, "Login failed"); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesHome.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testData.apartment); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesHome = createAddressPage.ClickOnSubmit(); addressesHome.IsAppBusy(); addressesHome.InformationModal.ClickOnClose(); addressesHome.IsAppBusy(); //start to update the address addressesHome.ClickOnAddressInDropdown(AccessLevel.User, testData); EditAddressPage editAddressPage = addressesHome.ContentModal.ClickOnEdit(); editAddressPage.SetInputValue(AddressInputs.Country, newAddress.country); editAddressPage.SetInputValue(AddressInputs.State, newAddress.state); editAddressPage.SetInputValue(AddressInputs.Street, newAddress.street); editAddressPage.SetInputValue(AddressInputs.City, newAddress.city); editAddressPage.SetInputValue(AddressInputs.Apartment, newAddress.apartment); editAddressPage.SetInputValue(AddressInputs.Postal, newAddress.postal); editAddressPage.SetCheckboxDefault(); addressesHome = editAddressPage.ClickOnSubmit(); addressesHome.IsAppBusy(); var dropdownItems = addressesHome.GetAddressesDropdownItems(AccessLevel.User).ToList(); //just edited address data string createdAddress = FormatAddress(newAddress); //search the address in the user level dropdown string expectedAddress = dropdownItems.FirstOrDefault(x => x.Contains("Default " + createdAddress)); Assert.IsNotNull(expectedAddress, "Address is not found in dropdown"); }