示例#1
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);
        }
示例#2
0
        public void Dashboard_Home_Giving_TurnOff()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            try
            {
                test.Dashboard.LoginWebDriver();
                test.GeneralMethods.WaitForPageIsLoaded();
                DashboardHomePage home = new DashboardHomePage(test.Driver, test.GeneralMethods);
                home.openSettingsPage();
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                settings.turnOffWidget(1);
                settings.closeSettingsPage();

                //verify the giving widget is removed
                Assert.IsFalse(home.getWidgetName(1).ToLower().Contains("giving"));

                home.openSettingsPage();
                settings.turnOnWidget(1);
                settings.closeSettingsPage();

                //verify the giving widget is back
                Assert.IsTrue(home.getWidgetName(1).ToLower().Contains("giving"));
            }
            finally
            {
                //clear test data
            }
        }
示例#3
0
        public void Dashboard_Home_Giving_BigNumber_ByDefault()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;
            DateTime          now     = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"));

            try
            {
                int churchId = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
                int userId   = test.SQL.User_FetchID(churchId, test.Dashboard.DashboardEmail, test.Dashboard.DashboardUsername);
                test.SQL.Dashboard_ClearData(churchId, test.Dashboard.DashboardUsername);

                test.Dashboard.LoginWebDriver();
                test.GeneralMethods.WaitForPageIsLoaded();
                DashboardHomePage     home     = new DashboardHomePage(test.Driver, test.GeneralMethods);
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);
                home.openSettingsPage();
                settings.turnOnWidget(1);
                settings.closeSettingsPage();

                string bigNumber      = home.getWidgetBigNumber(1);
                double subTotalOnPage = double.Parse(bigNumber.Replace("$", "").Replace(",", ""));

                DateTime[] dateRange    = test.Dashboard.getDateRange(now, "week", 1);
                double     subTotalInDb = test.SQL.Dashboard_Giving_GetPeriodSum(churchId, userId, dateRange[0], dateRange[1]);

                //verify the default big number on page is correct
                TestLog.WriteLine(string.Format("{0}|{1}", subTotalOnPage, subTotalInDb));
                Assert.AreEqual(subTotalOnPage, subTotalInDb);
            }
            finally
            {
                //clear test data
            }
        }
示例#4
0
        public void Dashboard_AttributeGroup_Home_BigNumber_NewAttributeGroup()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            int    churchId             = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
            string activeAttributeGroup = utility.GetUniqueName("aag");

            try
            {
                test.SQL.Admin_IndividualAttributeGroups_Create(churchId, activeAttributeGroup, true);
                test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, "salvation", true, true, false, false, true);

                test.Dashboard.LoginWebDriver();
                DashboardHomePage     home     = new DashboardHomePage(test.Driver, test.GeneralMethods);
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                home.openSettingsPage();
                int widgetsTotal        = settings.getWidgetsTotalOnPage();
                int turnedOnWidgetTotal = settings.getTurnedOnWidgetsTotalOnPage(widgetsTotal);

                for (int i = 1; i <= widgetsTotal; i++)
                {
                    if (settings.getWidgetName(i).Contains(activeAttributeGroup))
                    {
                        Assert.IsFalse(settings.isWidgetItemChecked(i, 1), "Active attribute 'salvation' should not be checked");
                        if (turnedOnWidgetTotal == 6)
                        {
                            settings.turnOffMultiWidgets(widgetsTotal, 1);
                        }
                        settings.turnOnWidget(i);

                        settings.checkWidgetItem(i, 1);

                        break;
                    }
                }

                settings.closeSettingsPage();
                home.selectView("year");

                for (int i = 1; i <= turnedOnWidgetTotal; i++)
                {
                    if (home.getWidgetName(i).Contains(activeAttributeGroup))
                    {
                        string bigNumber      = home.getWidgetBigNumber(i);
                        int    subTotalOnPage = int.Parse(bigNumber.Replace(",", ""));
                        Assert.AreEqual(subTotalOnPage, 0, "The big number of attribute group should be 0");
                        break;
                    }
                }
            }
            finally
            {
                //clear test data
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, "salvation");
                test.SQL.Admin_IndividualAttributeGroups_Delete(churchId, activeAttributeGroup);
            }
        }
示例#5
0
        public void Dashboard_Giving_NewGiving_Of_ContributionFund()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            //Test data parameters
            DateTime now         = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"));
            int      churchId    = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
            int      userId      = test.SQL.User_FetchID(churchId, test.Dashboard.DashboardEmail, test.Dashboard.DashboardUsername);
            string   fund_name_1 = utility.GetUniqueName("fund");
            string   card_number = "4111111111111111";
            string   card_type   = "Visa";

            try
            {
                test.SQL.Giving_Funds_Create(churchId, fund_name_1, true, null, 1, true, "Auto Testing");

                test.Dashboard.LoginWebDriver();
                test.GeneralMethods.WaitForPageIsLoaded();
                DashboardHomePage     home     = new DashboardHomePage(test.Driver, test.GeneralMethods);
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);
                home.openSettingsPage();
                settings.turnOnWidget(1);
                settings.closeSettingsPage();
                home.selectView("year");

                //string bigNumber = home.getWidgetBigNumber(1);
                //double subTotalOnPage = double.Parse(bigNumber.Replace("$", "").Replace(",", ""));

                //Do an online giving
                test.Infellowship.LoginWebDriver("*****@*****.**", "FT4life!");
                test.Infellowship.Giving_GiveNow_CreditCard_WithoutValidation_WebDriver(fund_name_1, "10000", card_type, card_number, 12, (DateTime.Now.Year + 5).ToString());
                test.Infellowship.LogoutWebDriver();

                test.Dashboard.OpenLoginWebDriver();
                home.openSettingsPage();
                settings.checkSubItemByName(1, fund_name_1);
                settings.closeSettingsPage();

                home.selectView("year");

                string bigNumberNew = home.getWidgetBigNumber(1);
                //double subTotalOnPageNew = double.Parse(bigNumberNew.Replace("$", "").Replace(",", ""));

                DateTime[] dateRange    = test.Dashboard.getDateRange(now, "year");
                double     subTotalInDb = test.SQL.Dashboard_Giving_GetPeriodSum(churchId, userId, dateRange[0], dateRange[1]);

                //verify the big number on page is correct
                //TestLog.WriteLine(string.Format("{0}|{1}|{2}", subTotalOnPage, subTotalInDb, subTotalOnPageNew));
                //Assert.IsTrue(subTotalInDb>=subTotalOnPage + 10000);
                //Assert.AreEqual(subTotalInDb, subTotalOnPageNew);
                Assert.AreEqual(bigNumberNew, test.Dashboard.getBigNumberStringGreaterThanMillion(subTotalInDb));
            }
            finally
            {
                //clear test data
                test.SQL.Giving_Funds_Delete(churchId, fund_name_1);
            }
        }
示例#6
0
        public void Dashboard_Home_Giving_BigNumber_TurnOffAllFunds()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;
            DateTime          now     = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"));

            string[] viewTypes = new string[] { "week", "month", "quarter", "year" };

            try
            {
                int churchId = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
                int userId   = test.SQL.User_FetchID(churchId, test.Dashboard.DashboardEmail, test.Dashboard.DashboardUsername);

                test.Dashboard.LoginWebDriver();
                test.GeneralMethods.WaitForPageIsLoaded();
                DashboardHomePage     home     = new DashboardHomePage(test.Driver, test.GeneralMethods);
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                home.openSettingsPage();

                int totalItems = settings.getWidgetSubItemsOnPage(1).Count;

                for (int i = 1; i <= totalItems; i++)
                {
                    settings.uncheckWidgetItem(1, i);
                }

                settings.closeSettingsPage();

                foreach (string viewType in viewTypes)
                {
                    home.selectView(viewType);

                    string bigNumber      = home.getWidgetBigNumber(1);
                    double subTotalOnPage = double.Parse(bigNumber.Replace("$", "").Replace(",", ""));

                    DateTime[] dateRange    = test.Dashboard.getDateRange(now, viewType, 1);
                    double     subTotalInDb = test.SQL.Dashboard_Giving_GetPeriodSum(churchId, userId, dateRange[0], dateRange[1]);

                    //verify the big number on page is correct
                    TestLog.WriteLine(string.Format("{0}|{1}", subTotalOnPage, subTotalInDb));
                    Assert.AreEqual(subTotalOnPage, subTotalInDb);
                    Assert.AreEqual(subTotalOnPage, 0);
                }

                home.openSettingsPage();

                for (int i = 1; i <= totalItems; i++)
                {
                    settings.checkWidgetItem(1, i);
                }
            }
            finally
            {
                //clear test data
                test.SQL.Dashboard_ClearData(test.SQL.FetchChurchID(test.Dashboard.ChurchCode), test.Dashboard.DashboardUsername);
            }
        }
        public void Dashboard_Setting_Giving_ReportRights_NotShow()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            int churchId = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
            int userId   = test.SQL.User_FetchID(churchId, test.Dashboard.DashboardEmail, test.Dashboard.DashboardUsername);

            try
            {
                test.Portal.LoginWebDriver(test.Dashboard.DashboardUsername, test.Dashboard.DashboardPassword, test.Dashboard.ChurchCode);

                test.Dashboard.uncheckAllRoles(userId);
                test.Dashboard.uncheckAccessRight(userId, "Contribution");
                test.Dashboard.uncheckAccessRight(userId, "Contributor Visibility");
                test.Dashboard.uncheckAccessRight(userId, "Contributor Summaries");

                test.Dashboard.LoginWebDriver();
                DashboardHomePage home = new DashboardHomePage(test.Driver, test.GeneralMethods);
                Assert.IsFalse(home.getWidgetName(1).ToLower().Contains("giving"));

                home.openSettingsPage();
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                //verify the giving widget is removed
                Assert.IsFalse(settings.getWidgetName(1).ToLower().Contains("giving"));

                test.Driver.Manage().Cookies.DeleteAllCookies();
                test.Portal.LoginWebDriver(test.Dashboard.DashboardUsername, test.Dashboard.DashboardPassword, test.Dashboard.ChurchCode);
                test.Dashboard.checkAccessRight(userId, "Contribution");
                test.Dashboard.checkAccessRight(userId, "Contributor Visibility");
                test.Dashboard.checkAccessRight(userId, "Contributor Summaries");
                //test.Dashboard.LoginWebDriver();
                test.Portal.LogoutWebDriver();
                test.Dashboard.OpenLoginWebDriver();

                //verify the giving widget is back
                home.openSettingsPage();
                Assert.IsTrue(settings.getWidgetName(1).ToLower().Contains("giving"));
                settings.turnOnWidget(1);

                //verify the giving widget is closed
                Assert.IsFalse(settings.isWidgetTurnedOn(1));
            }
            finally
            {
                //clear test data
                test.Driver.Manage().Cookies.DeleteAllCookies();
                test.Portal.LoginWebDriver(test.Dashboard.DashboardUsername, test.Dashboard.DashboardPassword, test.Dashboard.ChurchCode);
                test.Dashboard.checkAllRoles(userId);
            }
        }
示例#8
0
        public void Dashboard_AttributeGroup_Home_BigNumber_NewIndividual()
        {
            TestBaseWebDriver test    = base.TestContainer[Gallio.Framework.TestContext.CurrentContext.Test.Name];
            GeneralMethods    utility = test.GeneralMethods;

            DateTime now                             = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"));
            int      churchId                        = test.SQL.FetchChurchID(test.Dashboard.ChurchCode);
            int      userId                          = test.SQL.User_FetchID(churchId, test.Dashboard.DashboardEmail, test.Dashboard.DashboardUsername);
            string   activeAttributeGroup            = utility.GetUniqueName("aag");
            string   activeAttributeWithStartDate    = utility.GetUniqueName("aa1");
            string   activeAttributeWithoutStartDate = utility.GetUniqueName("aa2");
            string   individual_1                    = utility.GetUniqueName("ind1");
            string   individual_2                    = utility.GetUniqueName("ind2");
            string   individual_3                    = utility.GetUniqueName("ind3");
            string   individual_4                    = utility.GetUniqueName("ind4");

            test.SQL.Admin_IndividualAttributeGroups_Create(churchId, activeAttributeGroup, true);
            test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, activeAttributeWithStartDate, false, true, false, false, true);
            test.SQL.Admin_IndividualAttributes_Create(churchId, activeAttributeGroup, activeAttributeWithoutStartDate, false, false, false, false, true);
            test.SQL.People_Individual_Create(churchId, "AutoTest", individual_1);
            test.SQL.People_Individual_Create(churchId, "AutoTest", individual_2);
            test.SQL.People_Individual_Create(churchId, "AutoTest", individual_3);
            test.SQL.People_Individual_Create(churchId, "AutoTest", individual_4);
            int individual_1_id = test.SQL.People_Individuals_FetchID(churchId, "AutoTest " + individual_1);
            int individual_2_id = test.SQL.People_Individuals_FetchID(churchId, "AutoTest " + individual_2);
            int individual_3_id = test.SQL.People_Individuals_FetchID(churchId, "AutoTest " + individual_3);
            int individual_4_id = test.SQL.People_Individuals_FetchID(churchId, "AutoTest " + individual_4);

            int attributeGroupId             = test.SQL.Admin_Fetch_AttributeGroupID(churchId, activeAttributeGroup);
            int attributeId_withStartDate    = test.SQL.Admin_Fetch_AttributeID(churchId, attributeGroupId, activeAttributeWithStartDate);
            int attributeId_withoutStartDate = test.SQL.Admin_Fetch_AttributeID(churchId, attributeGroupId, activeAttributeWithoutStartDate);

            test.SQL.Dashboard_Insert_IndividualAttribute(churchId, individual_1_id, attributeId_withStartDate, now, now.AddYears(100));
            test.SQL.Dashboard_Insert_IndividualAttribute(churchId, individual_2_id, attributeId_withStartDate, now.AddDays(-370), now.AddYears(-1));
            test.SQL.Dashboard_Insert_IndividualAttribute(churchId, individual_3_id, attributeId_withoutStartDate, now.AddYears(100), now.AddYears(100));
            test.SQL.Dashboard_Insert_IndividualAttribute(churchId, individual_4_id, attributeId_withStartDate, now.AddDays(-2), now);

            try
            {
                test.Dashboard.LoginWebDriver();
                DashboardHomePage     home     = new DashboardHomePage(test.Driver, test.GeneralMethods);
                DashboardSettingsPage settings = new DashboardSettingsPage(test.Driver, test.GeneralMethods, test.SQL);

                home.openSettingsPage();
                int widgetsTotal        = settings.getWidgetsTotalOnPage();
                int turnedOnWidgetTotal = settings.getTurnedOnWidgetsTotalOnPage(widgetsTotal);

                for (int i = 1; i <= widgetsTotal; i++)
                {
                    if (settings.getWidgetName(i).Contains(activeAttributeGroup))
                    {
                        if (turnedOnWidgetTotal == 6)
                        {
                            settings.turnOffMultiWidgets(widgetsTotal, 1);
                        }
                        settings.turnOnWidget(i);

                        settings.checkWidgetItem(i, 1);
                        break;
                    }
                }

                settings.closeSettingsPage();
                home.selectView("year");

                DateTime[] dateRange    = test.Dashboard.getDateRange(now, "year");
                int        subTotalInDb = test.SQL.Dashboard_AttributeGroup_GetPeriodSum(churchId, userId, attributeGroupId, dateRange[0], dateRange[1]);

                for (int i = 1; i <= turnedOnWidgetTotal; i++)
                {
                    if (home.getWidgetName(i).Contains(activeAttributeGroup))
                    {
                        string bigNumber      = home.getWidgetBigNumber(i);
                        int    subTotalOnPage = int.Parse(bigNumber.Replace(",", ""));


                        //Verify only individual_1 will be counted
                        TestLog.WriteLine(string.Format("Page: {0}|Db: {1}", subTotalOnPage, subTotalInDb));
                        Assert.AreEqual(subTotalOnPage, subTotalInDb, string.Format("The big number of attribute group should equal to {0}", subTotalInDb));
                        break;
                    }
                }
            }
            finally
            {
                //clear test data
                test.SQL.Dashboard_Delete_IndividualAttribute(churchId, individual_1_id, attributeId_withStartDate);
                test.SQL.Dashboard_Delete_IndividualAttribute(churchId, individual_2_id, attributeId_withStartDate);
                test.SQL.Dashboard_Delete_IndividualAttribute(churchId, individual_3_id, attributeId_withoutStartDate);
                test.SQL.Dashboard_Delete_IndividualAttribute(churchId, individual_4_id, attributeId_withStartDate);
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, activeAttributeWithoutStartDate);
                test.SQL.Admin_IndividualAttributes_Delete(churchId, activeAttributeGroup, activeAttributeWithStartDate);
                test.SQL.Admin_IndividualAttributeGroups_Delete(churchId, activeAttributeGroup);
                test.SQL.People_Individual_Delete(churchId, "AutoTest", individual_1);
                test.SQL.People_Individual_Delete(churchId, "AutoTest", individual_2);
                test.SQL.People_Individual_Delete(churchId, "AutoTest", individual_3);
                test.SQL.People_Individual_Delete(churchId, "AutoTest", individual_4);
            }
        }
示例#9
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);
        }