コード例 #1
0
        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();
        }
コード例 #2
0
        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");
        }
コード例 #3
0
        public void MyAccountMenuOptionsNavigate()
        {
            IndexPage indexPage = new IndexPage(driver, url);

            LoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login("*****@*****.**", "1234");

            PaymentOptionsHomePage paymentsPage = indexPage.Header.ClickOnPaymentOptions();

            AddressesHomePage addressesPage = paymentsPage.Header.ClickOnAddresses();

            OrdersHomePage ordersPage = addressesPage.Header.ClickOnOrders();

            ContactInfoHomePage contactInfoPage = ordersPage.Header.ClickOnContactInfo();

            //pavito here
            //TODO:
            //Fix the dashboard page pls
            DashboardHomePage dashboardPage = contactInfoPage.Header.ClickOnDashboard();

            indexPage = dashboardPage.Header.ClickOnSignOut();

            Thread.Sleep(1500);
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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");
        }
コード例 #6
0
        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");
        }
コード例 #7
0
        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:");
        }
コード例 #8
0
        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");
        }
コード例 #9
0
        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");
        }
コード例 #10
0
        public void CheckBothDropdownsItemsCount()
        {
            //TODO: this TC needs specific test data (20 level account/user addresses)
            var testData = new { Email = "", Password = "" };


            APIndexPage indexPage = new APIndexPage(Driver, Url);

            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            indexPage = loginPage.Login(testData.Email, testData.Password);

            AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses();

            int accountLevelItemsCount = addressesPage.GetAddressesDropdownItems(AccessLevel.Account).Count();
            int userLevelItemsCount    = addressesPage.GetAddressesDropdownItems(AccessLevel.User).Count();

            Assert.IsTrue(accountLevelItemsCount > 20, "Account level dropdpown items count is not as expected");
            Assert.IsTrue(userLevelItemsCount > 20, "User level dropdown items count is not as expected");

            //addressesPage.Header.ClickOnSignOut();
        }
コード例 #11
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");
        }
コード例 #12
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);
        }
コード例 #13
0
        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");
        }
コード例 #14
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");
        }
コード例 #15
0
        //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");
        }
コード例 #16
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);
        }
コード例 #17
0
        public void E2E05()
        {
            APIndexPage indexPage = new APIndexPage(Driver, Url);

            // log in
            APLoginPage loginPage = indexPage.Header.ClickOnSignIn();

            loginPage.Login("*****@*****.**", "test1234");

            DashboardHomePage accountDashboard = indexPage.Header.ClickOnDashboard();

            Assert.IsTrue(accountDashboard.ContactInfoExist());

            ContactInfoEditPage contactInfoEdit = accountDashboard.ContactInfoEdit();

            Assert.AreEqual("Edit contact information", contactInfoEdit.GetSectionTitle());
            contactInfoEdit.ClickOnCancel();

            Assert.IsTrue(accountDashboard.AddressesExist());

            AddressesHomePage addressPage = accountDashboard.ClickAddressesLink();

            AddressModel addressModel = new AddressModel
            {
                street      = "134 Manton Street",
                apartment   = "134",
                state       = "Pennsylvania",
                city        = "Philadelphia",
                postal      = "19147",
                country     = "US",
                region      = "PA",
                CompanyName = "Test company"
            };

            addressPage.ClickOnAddressInDropdownStateInitials(AccessLevel.User, addressModel);
            addressPage.WaitForAppBusy();
            addressPage.ContentModal.ClickOnCancel();
            addressPage.WaitForAppBusy();

            /**/
            AddAddressPage addAddressPage = addressPage.ClickOnAddNewAddress();

            AddressModel newAddressModel = new AddressModel
            {
                street      = "134 Testing Street",
                apartment   = "134",
                state       = "Colorado",
                city        = "Aspen",
                postal      = "12345",
                country     = "US",
                region      = "CO",
                CompanyName = "Test company"
            };

            addAddressPage.SetInputValue(PageObjects.MyAccountPOM.AddressesPOM.AddressInputs.Country, newAddressModel.country);
            addAddressPage.SetInputValue(PageObjects.MyAccountPOM.AddressesPOM.AddressInputs.CompanyName, newAddressModel.CompanyName);
            addAddressPage.SetInputValue(PageObjects.MyAccountPOM.AddressesPOM.AddressInputs.Street, newAddressModel.street);
            addAddressPage.SetInputValue(PageObjects.MyAccountPOM.AddressesPOM.AddressInputs.Apartment, newAddressModel.apartment);
            addAddressPage.SetInputValue(PageObjects.MyAccountPOM.AddressesPOM.AddressInputs.City, newAddressModel.city);
            addAddressPage.SetInputValue(PageObjects.MyAccountPOM.AddressesPOM.AddressInputs.State, newAddressModel.state);
            addAddressPage.SetInputValue(PageObjects.MyAccountPOM.AddressesPOM.AddressInputs.Postal, newAddressModel.postal);

            addressPage = addAddressPage.ClickOnSubmit();
            addAddressPage.InformationModal.ClickOnClose();
            addressPage.WaitForAppBusy();


            addressPage.ClickOnAddressInDropdownStateInitials(AccessLevel.User, addressModel);
            addressPage.WaitForAppBusy();

            addressPage.ContentModal.ClickOnMakeDefault();
            addressPage.WaitForAppBusy();
            //TEMPORARY SOLUTION FOR LOADING ANIMATIONS AND LOADING TIMES
            System.Threading.Thread.Sleep(3000);

            addressPage.InformationModal.ClickOnClose();

            /*
             */

            accountDashboard = addressPage.Header.ClickOnDashboard();

            accountDashboard.WaitForAppBusy();
            Assert.IsTrue(accountDashboard.PaymentOptionsExist());

            PaymentOptionsEditPage paymentEditPage = accountDashboard.ClickEditPaymentLink();

            paymentEditPage.ClickOnCancel();

            PaymentOptionsHomePage paymentPage = accountDashboard.ClickPaymentsLink();

            Assert.IsTrue(paymentPage.PaymentOptionsTitleExist());
            IEnumerable <String> paymentItems = paymentPage.GetPaymentsDropdownItems(AccessLevel.Account);

            paymentPage.ClickOnPaymentOption(AccessLevel.Account, paymentItems.First());
            paymentPage.WaitForAppBusy();
            paymentPage.ContentModal.ClickOnMakeDefault();
            paymentPage.WaitForAppBusy();
            paymentPage.InfoModal.ClickOnClose();

            paymentItems = paymentPage.GetPaymentsDropdownItems(AccessLevel.User);

            paymentPage.ClickOnPaymentOption(AccessLevel.User, paymentItems.First());
            paymentPage.WaitForAppBusy();
            paymentPage.ContentModal.ClickOnMakeDefault();
            paymentPage.WaitForAppBusy();
            // TEMPORARY SOLUTION SO IFRAME LOADS AND DOM ELEMENT WAIT DOESN'T CRASH/FAIL THE TEST
            // *** FUTURE SOLUTION TO DO
            System.Threading.Thread.Sleep(4000);
            paymentPage.InfoModal.ClickOnClose();

            paymentPage.WaitForAppBusy();
            PaymentOptionsCreatePage paymentCreatePage = paymentPage.ClickOnAddNewCreditCard();

            // TEMPORARY SOLUTION SO IFRAME LOADS AND DOM ELEMENT WAIT DOESN'T CRASH/FAIL THE TEST
            // *** FUTURE SOLUTION TO DO
            System.Threading.Thread.Sleep(5000);

            PaymentOptionModel paymentOptionModel = new PaymentOptionModel
            {
                CardNumber     = "4111111111111111",
                ExpirationMont = "12",
                ExpirationYear = "2022",
                Cvv            = "077",
                HolderName     = "Test Test",
                LastFourDigits = "1293"
            };

            paymentCreatePage.WaitForAppBusy();
            paymentCreatePage.FillCardTokenForm(paymentOptionModel);
            paymentCreatePage.ClickOnMakeDefault();
            paymentCreatePage.SelectPreviouslyStoreAddress("Test company");
            paymentCreatePage.ClickOnSubmit();
            System.Threading.Thread.Sleep(3000);

            // assert if click on submit is valid ( assert/bool that all fields are valid)
            // if assert for click on submit is valid then assert modal if creditcard was a succesfully added
            paymentPage = paymentCreatePage.CloseModal(ModalsEnum.Information);

            // TEMPORARY SOLUTION
            System.Threading.Thread.Sleep(3000);

            // step to change to a US adress and change state to colorado
            // this before searching for item


            //
            indexPage.Header.SetSearchFieldText("KE50750-4");
            CatalogItemsPage catalogItemsPage = indexPage.Header.ClickOnSearchButton();

            catalogItemsPage.AddToCartFirstItemInCatalog();

            APCartPage cartPage = indexPage.Header.ClickOnViewCart();

            // TEMPORARY SOLUTION
            System.Threading.Thread.Sleep(6000);
        }