Exemple #1
0
        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);
        }
Exemple #2
0
        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");
        }
Exemple #3
0
        public void EditUserLevelAddress()
        {
            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    = "Elm Street",
                apartment = "apt no. 123",
                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 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.WaitForAppBusy();
            addressesHome.InformationModal.ClickOnClose();
            addressesHome.WaitForAppBusy();

            //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();
            addressesHome.WaitForAppBusy();

            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");
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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");
        }