public void DesignateAccountAddressAsDefault() { var testData = TestDataFactory.UserWithAccountAddress(); APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testData.Email, testData.Password); Assert.IsNotNull(indexPage, "Login failed"); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); addressesHome.ClickOnAddressInDropdown(AccessLevel.Account, testData.Address); addressesHome.ContentModal.ClickOnMakeDefault(); addressesHome.WaitForAppBusy(); addressesHome.InformationModal.ClickOnClose(); bool defaultLabelExist = addressesHome.IsDefaultLabelPresentOnDropdownItem(AccessLevel.Account); string actualDefaultAddress = addressesHome.GetDefaultTileAddressData(AccessLevel.Account); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.street), $"street not found, {testData.Address.street}"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.apartment), $"apartment not found, {testData.Address.apartment}"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.country), $"country not found, {testData.Address.country}"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.postal), $"postal not found, {testData.Address.postal}"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.state), $"state not found, {testData.Address.state}"); bool userTileExist = addressesHome.DefaultTileExist(AccessLevel.User); Assert.IsFalse(userTileExist, "default user level tile is already present"); //addressesHome.Header.ClickOnSignOut(); }
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 DesignateAccountAddressAsDefault() { //test data TestAccountAddress testAddress = new TestAccountAddress { Apartment = "349", City = "Denver", Country = "US", CompanyName = "dfs", Postal = "80019", StateProvinceRegion = "CO", Street = "Walnut street", ExternalIdentifier = nameof(testAddress) + "C1108" }; AddressModel selectedAddress = new AddressModel { apartment = testAddress.Apartment, city = testAddress.City, country = testAddress.Country, CompanyName = testAddress.CompanyName, postal = testAddress.Postal, state = testAddress.StateProvinceRegion, street = testAddress.Street }; //this method is not ready var testUser = DataFactory.Users.CreateTestUser(); APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); addressesHome.ClickOnAddressInDropdown(AccessLevel.Account, selectedAddress); addressesHome.ContentModal.ClickOnMakeDefault(); //TODO //check if busy is present addressesHome.WaitForAppBusy(); addressesHome.InformationModal.ClickOnClose(); bool defaultLabelExist = addressesHome.IsDefaultLabelPresentOnDropdownItem(AccessLevel.Account); string actualDefaultAddress = addressesHome.GetDefaultTileAddressData(AccessLevel.Account); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.Street), $"street not found, {testAddress.Street}"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.Apartment), $"apartment not found, {testAddress.Apartment}"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.Country), $"country not found, {testAddress.Country}"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.Postal), $"postal not found, {testAddress.Postal}"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.StateProvinceRegion), $"state not found, {testAddress.StateProvinceRegion}"); bool userTileExist = addressesHome.DefaultTileExist(AccessLevel.User); Assert.IsFalse(userTileExist, "default user level tile is already present"); }
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 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 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"); }