Ejemplo n.º 1
0
        public void TC_VerifyCourseSubMenuOptions()
        {
            //Page_Login plogin = new Page_Login();
            //plogin.Login();

            //Page_HAPrompt haprompt = new Page_HAPrompt();
            //haprompt.GoToDashboard();

            Common cmn = new Common();

            cmn.ClickCourseMenu();

            int             optionno      = 4;
            Page_Dashboard  dashbrd       = new Page_Dashboard(softassertions);
            List <String[]> coursesubmenu = CSVReaderDataTable.GetCSVData("LeftSubmenuContent", pageName, "coursessubmenu", "allclients");

            dashbrd.Verify_LeftSubMenuOptions(coursesubmenu, optionno);

            List <String[]> specific_coursesubmenu = CSVReaderDataTable.GetCSVData("LeftSubmenuContent", pageName, "specific_coursessubmenu");

            dashbrd.Verify_LeftSubMenuOptions(specific_coursesubmenu, optionno);


            cmn.CloseHamMenu();
            is_soft_assert = true;
            softassertions.AssertAll();
        }
        /// <summary>
        /// 1. Enters Data in the specified locators
        /// 2. Verifies History Header
        /// 3. Verifies first 3 values of Tracker in history
        /// </summary>
        /// <returns></returns>
        private void InputAndUpdateTrackerData()
        {
            List <string[]> trackerdata = CSVReaderDataTable.GetCSVData("InputDataContent", pageName, "oraldata");
            List <string[]> historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryheader");


            Common        date = new Common(softAssertions);
            CommonTracker oral = new CommonTracker(softAssertions);

            date.VerifyDate();

            int brushing = Convert.ToInt32(trackerdata.ElementAt(0)[4]);
            int flossing = Convert.ToInt32(trackerdata.ElementAt(1)[4]);

            for (int i = 0; i <= 2; i++)
            {
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(0)[3], brushing.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(1)[3], flossing.ToString());
                JavaScriptKeywords.SetTextByControlId("DataPointDate", date.GetDate()[i]);
                oral.ClickUpdateButton();
                oral.ClickViewHistory();
                if (i == 0)
                {
                    oral.ValidateHistoryHeader(historydata, pageName);
                    historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryvalue");
                }

                String historytabledata = Convert.ToDateTime(date.GetDate()[i]).ToString("dddd, MMM dd yyyy") + "|" + brushing.ToString() + "|" + flossing.ToString();
                historydata.ElementAt(0)[4] = historytabledata;

                oral.ValidateHistoryData(historydata, pageName);
                brushing += 2;
                flossing += 1;
            }
        }
Ejemplo n.º 3
0
        public void TC_VerifyCoachingSubMenuOptions()
        {
            //Page_Login plogin = new Page_Login();
            //plogin.Login();

            //Page_HAPrompt haprompt = new Page_HAPrompt();
            //haprompt.GoToDashboard();
            coachingEnabled = cmn.GetConfig("CoachingEnabled").ElementAt(0)[1].ToLower();
            if (coachingEnabled.Equals("false"))
            {
                Assert.Ignore("Coaching not enabled for client");
            }
            cmn.ClickGoalMenu();

            int             optionno = 16;
            Page_Dashboard  dashbrd  = new Page_Dashboard(softassertions);
            List <String[]> popupmsg = CSVReaderDataTable.GetCSVData("LeftSubmenuContent", pageName, "coachingsubmenu", "allclients");

            dashbrd.Verify_LeftSubMenuOptions(popupmsg, optionno);

            cmn.CloseHamMenu();

            is_soft_assert = true;
            softassertions.AssertAll();
        }
        /// <summary>
        /// This method verify all the error messages(First Name, Primary Phone no, Secondary Phone No)
        /// First it will call all the methods which will blank the text fields
        /// </summary>
        private void ValidateBlankFieldsErrorMsg()
        {
            List <string[]> result = new List <string[]>();

            errordata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "errormsg");

            ClickMyInfoEditBtn();
            ClearFirstNameTxtBox();
            ClearPrimaryPhoneNumber();
            ClearSecondaryPhoneNumber();

            for (int i = 0; i < errordata.Count; i++)
            {
                string elementname        = errordata.ElementAt(i)[2];
                string elementlocatorname = errordata.ElementAt(i)[3];
                string experrortext       = errordata.ElementAt(i)[4];
                if ((i == errordata.Count - 1) && (GlobalVariables.clientname.ToLower().Equals("meabt")))
                {
                    //
                }
                else
                {
                    string actualerrortext = SeleniumKeywords.GetText(pageName, elementlocatorname);
                    softAssertions.Add("Element : " + errordata.ElementAt(i)[2], experrortext, actualerrortext, "equals");
                }
            }
        }
        private void ValidateSetUpScreen()
        {
            System.Threading.Thread.Sleep(3000);
            plandata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "setup");
            for (int i = 0; i < plandata.Count; i++)
            {
                string elementname        = plandata.ElementAt(i)[2];
                string elementlocatorname = plandata.ElementAt(i)[3];
                string expectedtext       = "";

                if (i == 5)
                {
                    try
                    {
                        expectedtext = Convert.ToDateTime(tdate).ToString("MMMM d, yyyy", CultureInfo.InvariantCulture);
                    }
                    catch (System.FormatException fe)
                    {
                        Console.WriteLine("Date format is not correct");
                    }
                }
                else
                {
                    expectedtext = plandata.ElementAt(i)[4];
                }

                string actualtext = SeleniumKeywords.GetText(pageName, elementlocatorname);
                softassertions.Add(elementname, expectedtext, actualtext, "contains");
            }
        }
Ejemplo n.º 6
0
        public void VerifyNotRecommendedCoaching()
        {
            Common config    = new Common();
            string isenabled = config.GetConfig("CoachingEnabled").ElementAt(0)[1].ToLower();

            if (isenabled.Equals("false"))
            {
                Assert.Ignore("Coaching not enabled for client");
            }
            //Login lgn = new Login();
            //lgn.TC_VerifyLogin();
            //Page_HAPrompt haprompt = new Page_HAPrompt();
            Page_CoachingLearnMore ptlm = new Page_CoachingLearnMore(softassertions);
            Common com = new Common();

            com.ClickGoalMenu();
            com.ClickOnLearnMore();
            List <String[]> devicename = CSVReaderDataTable.GetCSVData("CoachingContent", "Page_CoachingLearnMore", "notrecomandationtile");

            // pdevices.ClickOnFitnessCheckBox();
            is_soft_assert = true;
            for (int i = 0; i < devicename.Count; i++)
            {
                ptlm.VerifyNotRecommandedCoaching(devicename.ElementAt(i)[4]);
            }
            softassertions.AssertAll();
        }
Ejemplo n.º 7
0
        private void FillEmotionalHealthModule()
        {
            System.Threading.Thread.Sleep(3000);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");

            List <string[]> haelements = new List <string[]>();

            haelements = CSVReaderDataTable.GetCSVData(inputfilename, pageName, "emotionalhealthmodule");

            for (int i = 0; i < haelements.Count; i++)
            {
                string elementname        = haelements.ElementAt(i)[2];
                string elementlocatorname = haelements.ElementAt(i)[3];
                string variablevalue      = haelements.ElementAt(i)[4];
                JavaScriptKeywords.ScrollToAnElement(pageName, elementlocatorname, variablevalue);
                SeleniumKeywords.Click(pageName, elementlocatorname, variablevalue);
            }

            //SeleniumKeywords.Click(pageName, "emotionalhealth_no_lostallinterest");
            //SeleniumKeywords.Click(pageName, "emotionalhealth_no_feltdepressed_feltokaysometimes");
            //SeleniumKeywords.Click(pageName, "emotionalhealth_no_feltdepressed_muchofthetime");
            //SeleniumKeywords.Click(pageName, "emotionalhealth_sometimes_unabletocontrolthings");
            //SeleniumKeywords.Click(pageName, "emotionalhealth_sometimes_handlepersonalproblems");
            //SeleniumKeywords.Click(pageName, "emotionalhealth_sometimes_thingsgoingyourway");
            //SeleniumKeywords.Click(pageName, "emotionalhealth_sometimes_difficultiespillingup");
            SeleniumKeywords.IframeScrollDown();
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
        public void TC_VerifyPHRPage()
        {
            //Page_Login lgn = new Page_Login();
            //lgn.Login();

            Common cmn        = new Common();
            string phrEnabled = cmn.GetConfig("PHREnabled").ElementAt(0)[1].ToLower();

            if (phrEnabled.Equals("false"))
            {
                Assert.Ignore("PHR not available for client");
            }
            cmn.ClickOnResources();

            Page_PHR        phc       = new Page_PHR();
            List <string[]> actualtxt = CSVReaderDataTable.GetCSVData("ResourcesContent", "PHR", "pageheading");
            string          atrval    = phc.VerifyPHRPageHeader();

            //Console.WriteLine("actualtxt" + atrval + "expected" + actualtxt.ElementAt(0)[4]);
            Assert.AreEqual(actualtxt.ElementAt(0)[4], atrval);

            actualtxt = CSVReaderDataTable.GetCSVData("ResourcesContent", "PHR", "divheading");
            atrval    = phc.VerifyPHRPage();
            //Console.WriteLine("actualtxt" + atrval + "expected" + actualtxt.ElementAt(0)[4]);
            Assert.AreEqual(actualtxt.ElementAt(0)[4], atrval);
        }
        private List <string[]> VerifyFormContent()
        {
            System.Threading.Thread.Sleep(4000);
            List <string[]> ExpectedText = new List <string[]>();

            ExpectedText = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "headers");
            Console.WriteLine("ExpectedText length : " + ExpectedText.Count);
            List <string[]> result = new List <string[]>();

            for (int i = 0; i < ExpectedText.Count; i++)
            {
                string elementname  = ExpectedText.ElementAt(i)[2];
                string locatorname  = ExpectedText.ElementAt(i)[3];
                string expectedtext = ExpectedText.ElementAt(i)[4];
                string actualtext   = SeleniumKeywords.GetText(pageName, locatorname);
                bool   textmatch    = SeleniumKeywords.VerifyText(actualtext, expectedtext);
                string msg          = "Element : " + elementname + " , Expected : " + expectedtext + " , Actual : " + actualtext;
                result.Add(new string[] { msg, textmatch.ToString() });
            }
            List <string[]> options = new List <string[]>();

            options = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "labels");
            for (int i = 0; i < options.Count; i++)
            {
                string elementname = options.ElementAt(i)[2];
                string locatorname = options.ElementAt(i)[3];
                bool   status      = SeleniumKeywords.IsElementPresent(pageName, locatorname);
                string msg         = "Element : " + elementname + " not displayed";
                result.Add(new string[] { msg, status.ToString() });
            }
            return(result);
        }
        private void InputAndUpdateNonBlendedTrackerData()
        {
            List <string[]> trackerdata = CSVReaderDataTable.GetCSVData("InputDataContent", pageName, "weightdata");
            List <string[]> historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "nonblendedtrackerhistoryheader");

            Common date = new Common(softAssertions);

            date.VerifyDate();


            CommonTracker wt = new CommonTracker(softAssertions);
            int           changevalueindex = 0;

            int weightvalue = Convert.ToInt32(trackerdata.ElementAt(0)[4]);

            for (int i = 0; i <= 2; i++)
            {
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(0)[3], weightvalue.ToString());
                JavaScriptKeywords.SetTextByControlId("DataPointDate", date.GetDate()[i]);
                wt.ClickUpdateButton();
                wt.ClickViewHistory();
                //System.Threading.Thread.Sleep(3000);
                if (i == 0)
                {
                    wt.ValidateHistoryHeader(historydata, pageName);
                    historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "nonblendedtrackerhistoryvalue");
                }

                String historytabledata = Convert.ToDateTime(date.GetDate()[i]).ToString("dddd, MMM dd yyyy") + "|" + weightvalue.ToString();
                historydata.ElementAt(changevalueindex)[4] = historytabledata;

                wt.ValidateHistoryData(historydata, pageName);
                weightvalue += 50;
            }
        }
        private void SetDietaryHabitsGoalForFutureDate()
        {
            List <string[]> currentstatus = CSVReaderDataTable.GetCSVData("InputDataContent", pageName, "currentstatus");

            for (int i = 0; i < currentstatus.Count; i++)
            {
                string elementname        = currentstatus.ElementAt(i)[2];
                string elementlocatorname = currentstatus.ElementAt(i)[3];
                string inputvalue         = currentstatus.ElementAt(i)[4];
                SeleniumKeywords.SetText(pageName, elementlocatorname, inputvalue);
            }

            List <string[]> setgoalstatus = CSVReaderDataTable.GetCSVData("InputDataContent", pageName, "setgoalstatus");

            for (int i = 0; i < setgoalstatus.Count; i++)
            {
                string elementname        = setgoalstatus.ElementAt(i)[2];
                string elementlocatorname = setgoalstatus.ElementAt(i)[3];
                string inputvalue         = setgoalstatus.ElementAt(i)[4];
                SeleniumKeywords.SetText(pageName, elementlocatorname, inputvalue);
            }

            tdate = cmn.AddDaysInCurrentDate(20);
            Console.WriteLine("Goal Date : " + tdate);
            JavaScriptKeywords.SetTextByControlId("DataPointDate", tdate);
        }
Ejemplo n.º 12
0
        public void TC_VerifyWeightTrackerUIElements()
        {
            // Skip Intro
            Page_SkipIntro skipIntro = new Page_SkipIntro();

            skipIntro.ClickSkipIntro();

            // Perform Login
            Page_MLogin plogin = new Page_MLogin();

            plogin.moblogin();

            // Close all Overlays (Popups)
            Page_MDashboard dashboard = new Page_MDashboard();

            dashboard.CloseAllDashboardOverlays();

            //Navigate to Tracker Home Page
            Page_MProfile trcker = new Page_MProfile();

            trcker.NavigateToTrackerHomePage();

            //Navigate to Weight Tracker
            CommonTrackers ct = new CommonTrackers(softassertions);

            ct.NavigateToTracker("Weight");

            //Validate Page UI Elements
            List <string[]> uielements = CSVReaderDataTable.GetCSVData("MobileTrackerData", pageName, "uielements");

            ct.ValidatePageUI(uielements, "Page_MWeightTracker");
            softassertions.AssertAll();
        }
Ejemplo n.º 13
0
        private void FillHistoryModule()
        {
            System.Threading.Thread.Sleep(5000);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");

            List <string[]> haelements = new List <string[]>();

            haelements = CSVReaderDataTable.GetCSVData(inputfilename, pageName, "historymodule");

            for (int i = 0; i < haelements.Count; i++)
            {
                string elementname        = haelements.ElementAt(i)[2];
                string elementlocatorname = haelements.ElementAt(i)[3];
                string variablevalue      = haelements.ElementAt(i)[4];
                JavaScriptKeywords.ScrollToAnElement(pageName, elementlocatorname, variablevalue);
                SeleniumKeywords.Click(pageName, elementlocatorname, variablevalue);
            }

            //SeleniumKeywords.Click(pageName, "history_no_cancer");
            //SeleniumKeywords.Click(pageName, "history_no_heartdisease");
            //SeleniumKeywords.Click(pageName, "history_no_osteoporosis");
            //SeleniumKeywords.Click(pageName, "history_no_migraine");
            //SeleniumKeywords.Click(pageName, "history_no_arthritis");
            //SeleniumKeywords.Click(pageName, "history_no_asthma");
            //SeleniumKeywords.Click(pageName, "history_no_backpain");
            SeleniumKeywords.IframeScrollDown();
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
Ejemplo n.º 14
0
        //[Category("ProdSanity")]
        //[Category("Regression")]
        public void TC_VerifyListOfNutritionMyNutritrion()
        {
            if (nutritionEnabled.Equals("false"))
            {
                Assert.Ignore("Nutrition Apps not available for Client");
            }
            //To call the Page Login Method
            //Login lgn = new Login();
            //lgn.TC_VerifyLogin();
            //Page_HAPrompt haprompt = new Page_HAPrompt();
            Common devices = new Common();

            devices.ClickDevicesAndApps();
            Page_DevicesAndApps pdevices = new Page_DevicesAndApps(Base.softassertions);

            pdevices.NavigateToMyNuterition();
            List <String[]> devicename = CSVReaderDataTable.GetCSVData("DeviceAppContent", "DevicesAndApps", "nutritiondevicename");

            //pdevices.ClickOnNutritionCheckBox();
            for (int i = 0; i < devicename.Count; i++)
            {
                pdevices.VerifyNutritionDevicesFromFilter(devicename.ElementAt(i)[4]);
            }
            is_soft_assert = true;
            softassertions.AssertAll();
        }/*
        /// <summary>
        /// 1. Enters Data in the specified locators
        /// 2. Verifies History Header
        /// 3. Verifies first 3 values of Tracker in history
        /// </summary>
        /// <returns></returns>
        private void InputAndUpdateTrackerData()
        {
            List <string[]> result      = new List <string[]>();
            List <string[]> trackerdata = CSVReaderDataTable.GetCSVData("InputDataContent", pageName, "sleepdata");
            List <string[]> historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryheader");
            Common          date        = new Common(softAssertions);
            CommonTracker   sl          = new CommonTracker(softAssertions);

            date.VerifyDate();

            int changevalueindex = 0;

            int sleepvalue = Convert.ToInt32(trackerdata.ElementAt(0)[4]);

            for (int i = 0; i <= 2; i++)
            {
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(0)[3], sleepvalue.ToString());
                JavaScriptKeywords.SetTextByControlId("DataPointDate", date.GetDate()[i]);
                sl.ClickUpdateButton();
                sl.ClickViewHistory();
                if (i == 0)
                {
                    sl.ValidateHistoryHeader(historydata, pageName);
                    historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryvalue");
                }

                String historytabledata = Convert.ToDateTime(date.GetDate()[i]).ToString("dddd, MMM dd yyyy") + "|" + sleepvalue.ToString();
                historydata.ElementAt(0)[4] = historytabledata;

                sl.ValidateHistoryData(historydata, pageName);
                sleepvalue += 2;
            }
        }
Ejemplo n.º 16
0
        public void TC_VerifyLoginPageOfDevices()
        {
            List <string[]> isEnabled = cmn.GetConfig("FitnessDevice", "IncentiveEnabled", "NutritionApp");

            fitnessEnabled   = isEnabled.ElementAt(0)[1].ToLower();
            incentiveEnabled = isEnabled.ElementAt(0)[2].ToLower();
            nutritionEnabled = isEnabled.ElementAt(0)[3].ToLower();
            if (fitnessEnabled.Equals("false") && nutritionEnabled.Equals("false"))
            {
                Assert.Ignore("Device and Apps not available for Client");
            }
            else if (fitnessEnabled.Equals("false"))
            {
                Assert.Ignore("Fitness devices not available for Client");
            }

            Common devices = new Common();

            devices.ClickDevicesAndApps();
            Page_DevicesAndApps pdevices = new Page_DevicesAndApps(softassertions);
            //pdevices.NavigateToManageDevices();
            List <String[]> devicename = CSVReaderDataTable.GetCSVData("DeviceAppContent", pageName, "devicename");

            // pdevices.ClickOnFitnessCheckBox();
            Console.WriteLine("Device Name   *******" + devicename);
            pdevices.VerifyLoginPageAllDevices(devicename);
            is_soft_assert = true;
            softassertions.AssertAll();
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Verify UI elements on the getstarted page
        /// </summary>
        public void VerifyPageUI()
        {
            Common cmn        = new Common();
            string clientname = GlobalVariables.clientname.ToLower();
            string isSSO      = cmn.GetConfig("SSO").ElementAt(0)[1].ToLower();

            if (isSSO.Equals("false") || clientname.Equals("health trust") || clientname.Equals("dollar general"))
            {
                List <String[]> uielements = CSVReaderDataTable.GetCSVData("RegistrationUIData", pageName, "nonsso_loginpref_uielem");
                for (int i = 0; i < uielements.Count(); i++)
                {
                    string locatorname = uielements.ElementAt(i)[3];
                    string elementname = uielements.ElementAt(i)[2];

                    bool actualstatus = SeleniumKeywords.IsElementPresent(pageName, locatorname);
                    softAssertion.Add(elementname, true, actualstatus, "equals");
                }
            }

            List <String[]> elements = CSVReaderDataTable.GetCSVData("RegistrationUIData", pageName, "loginpref_uielem");

            for (int i = 0; i < elements.Count(); i++)
            {
                string locatorname = elements.ElementAt(i)[3];
                string elementname = elements.ElementAt(i)[2];

                bool actualstatus = SeleniumKeywords.IsElementPresent(pageName, locatorname);
                softAssertion.Add(elementname, true, actualstatus, "equals");
            }
        }
Ejemplo n.º 18
0
        public void TC_VerifyListOfWeightDevicesAndApps()
        {
            List <string[]> isEnabled = cmn.GetConfig("FitnessDevice", "IncentiveEnabled", "NutritionApp");

            fitnessEnabled   = isEnabled.ElementAt(0)[1].ToLower();
            incentiveEnabled = isEnabled.ElementAt(0)[2].ToLower();
            nutritionEnabled = isEnabled.ElementAt(0)[3].ToLower();
            if (fitnessEnabled.Equals("false") && nutritionEnabled.Equals("false"))
            {
                Assert.Ignore("Device and Apps not available for Client");
            }
            if (GlobalVariables.clientname.ToLower().Equals("onlife health") || GlobalVariables.clientname.ToLower().Equals("health trust"))
            {
                //To call the Page Login Method
                //Login lgn = new Login();
                //lgn.TC_VerifyLogin();
                Page_HAPrompt haprompt = new Page_HAPrompt();
                Common        devices  = new Common();
                devices.ClickDevicesAndApps();
                Page_DevicesAndApps pdevices = new Page_DevicesAndApps(Base.softassertions);
                //pdevices.NavigateToManageDevices();
                List <String[]> devicename = CSVReaderDataTable.GetCSVData("DeviceAppContent", pageName, "weightdevicename");
                pdevices.ClickOnWeightCheckBox();
                for (int i = 0; i < devicename.Count; i++)
                {
                    pdevices.VerifyWeightDevicesFromFilter(devicename.ElementAt(i)[4]);
                }
                is_soft_assert = true;
                softassertions.AssertAll();
            }
            else
            {
                Assert.Ignore("Test Case skipped as Weight Devices not available for client");
            }
        }
Ejemplo n.º 19
0
        public void TC_VerifyListOfFitnessDevicesAndApps()
        {
            List <string[]> isEnabled = cmn.GetConfig("FitnessDevice", "IncentiveEnabled", "NutritionApp");

            fitnessEnabled   = isEnabled.ElementAt(0)[1].ToLower();
            incentiveEnabled = isEnabled.ElementAt(0)[2].ToLower();
            nutritionEnabled = isEnabled.ElementAt(0)[3].ToLower();
            if (fitnessEnabled.Equals("false") && nutritionEnabled.Equals("false"))
            {
                Assert.Ignore("Device and Apps not available for Client");
            }
            else if (fitnessEnabled.Equals("false"))
            {
                Assert.Ignore("Fitness Devices not available for Client");
            }

            Common devices = new Common();

            devices.ClickDevicesAndApps();
            Page_DevicesAndApps pdevices = new Page_DevicesAndApps(softassertions);
            //pdevices.NavigateToManageDevices();
            List <String[]> devicename = CSVReaderDataTable.GetCSVData("DeviceAppContent", pageName, "fitnessdevicename");

            pdevices.ClickOnFitnessCheckBox();
            for (int i = 0; i < devicename.Count; i++)
            {
                pdevices.VerifyFitnessDevicesFromFilter(devicename.ElementAt(i)[4]);
                if (i == 8)
                {
                    pdevices.ClickOnNextPage();
                }
            }
            is_soft_assert = true;
            softassertions.AssertAll();
        }
Ejemplo n.º 20
0
        private void VerifyMoreResourcesTile(string viewbtn_elementlocatorname, string viewbtn_varinputvalue, string category)
        {
            SeleniumKeywords.Click(pageName, viewbtn_elementlocatorname, viewbtn_varinputvalue);

            Console.WriteLine("Switch to second tab");
            SeleniumKeywords.SwitchToTab(2);

            List <string[]> finwellbeingmoreresources = new List <string[]>();

            finwellbeingmoreresources = CSVReaderDataTable.GetCSVData("FinancialWellBeingContent", pageName, category);


            System.Threading.Thread.Sleep(4000);

            for (int i = 0; i < finwellbeingmoreresources.Count; i++)
            {
                string elementname             = finwellbeingmoreresources.ElementAt(i)[2];
                string elementlocatorname      = finwellbeingmoreresources.ElementAt(i)[3];
                string expected_display_status = finwellbeingmoreresources.ElementAt(i)[4];

                Boolean actual_display_status = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname);
                softAssertions.Add("Element : " + elementname, expected_display_status, actual_display_status.ToString(), "equals");
            }
            Console.WriteLine("Close Current Tab");
            SeleniumKeywords.CloseCurrentTab();
            SeleniumKeywords.SwitchToTab(1);
            Console.WriteLine("Switch to first tab");
        }
        public void TC_VerifyLoginPreference()
        {
            //Navigate to Get Started Page
            Page_Registration reg = new Page_Registration(softassertions);

            reg.ClickGetStarted();

            userinfo.Add(GlobalVariables.firstname);
            userinfo.Add(GlobalVariables.lastname);
            userinfo.Add(GlobalVariables.dob);
            userinfo.Add(GlobalVariables.zipcode);
            userinfo.Add(GlobalVariables.popseg1);
            userinfo.Add(GlobalVariables.ssn);

            // Enter valid details in GetStarted Page
            reg.FillGetStartedDetails(userinfo, additionalDetails);
            reg.ClickUAContinue();

            Assert.IsTrue(reg.AtLoginPreference(), "Login Preference Page not displayed");

            is_soft_assert = true;

            //Verify Login Prefrence elements
            reg.VerifyPageUI();

            //Verify error messages
            List <String[]> errmsgs = CSVReaderDataTable.GetCSVData("RegistrationUIData", "Registration", "loginpref_errormsg");

            reg.VerifyErrorMsgs(errmsgs);

            softassertions.AssertAll();
        }
Ejemplo n.º 22
0
        public void TC_VerifyResourcesSubMenuOptions()
        {
            //Page_Login plogin = new Page_Login();
            //plogin.Login();

            //Page_HAPrompt haprompt = new Page_HAPrompt();
            //haprompt.GoToDashboard();

            Common cmn = new Common();

            cmn.ClickOnResources();

            int            optionno = 54;
            Page_Dashboard dashbrd  = new Page_Dashboard(softassertions);

            List <String[]> popupmsg = CSVReaderDataTable.GetCSVData("LeftSubmenuContent", pageName, "resourcessubmenu", "allclients");

            TestContext.WriteLine("Data: " + popupmsg.Count);
            dashbrd.Verify_LeftSubMenuOptions(popupmsg, optionno);

            List <String[]> specific_resourcessubmenu = CSVReaderDataTable.GetCSVData("LeftSubmenuContent", pageName, "specific_resourcessubmenu");

            dashbrd.Verify_LeftSubMenuOptions(specific_resourcessubmenu, optionno);

            cmn.CloseHamMenu();

            is_soft_assert = true;
            softassertions.AssertAll();
        }
        public List <string[]> GetQuestionErrorMessage()

        {
            SeleniumKeywords.NavigateToIFrame("assessmentFrame");
            System.Threading.Thread.Sleep(6000);

            Console.WriteLine("GetQuestionErrorMessage   function started.....");

            SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn");
            List <string[]> expectedresult = new List <string[]>();
            List <string[]> result         = new List <string[]>();

            Console.WriteLine("GetQuestionErrorMessage   data read function started.....");
            expectedresult = CSVReaderDataTable.GetCSVData("ProgressCheckinData", pageName, "errormsg");


            for (int i = 0; i < expectedresult.Count; i++)
            {
                string elementname      = expectedresult.ElementAt(i)[2];
                string expelementtxt    = expectedresult.ElementAt(i)[3];
                string actualelementtxt = SeleniumKeywords.GetText(pageName, elementname);

                bool   textmatch = SeleniumKeywords.VerifyText(actualelementtxt, expelementtxt);
                string msg       = "Element : " + elementname + " , Expected : " + expelementtxt + " , Actual : " + actualelementtxt;
                result.Add(new string[] { msg, textmatch.ToString() });
                Console.WriteLine(msg);
            }


            return(result);
        }
Ejemplo n.º 24
0
        private void FillDietModule()
        {
            System.Threading.Thread.Sleep(3000);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");

            List <string[]> haelements = new List <string[]>();

            haelements = CSVReaderDataTable.GetCSVData(inputfilename, pageName, "dietmodule");

            for (int i = 0; i < haelements.Count; i++)
            {
                string elementname        = haelements.ElementAt(i)[2];
                string elementlocatorname = haelements.ElementAt(i)[3];
                string variablevalue      = haelements.ElementAt(i)[4];
                JavaScriptKeywords.ScrollToAnElement(pageName, elementlocatorname, variablevalue);
                SeleniumKeywords.Click(pageName, elementlocatorname, variablevalue);
            }

            //SeleniumKeywords.Click(pageName, "diet_3servings_fruit");
            //SeleniumKeywords.Click(pageName, "diet_3servings_vegetables");
            //SeleniumKeywords.Click(pageName, "diet_3servings_wholegrains");
            //SeleniumKeywords.Click(pageName, "diet_2servings_diaryproducts");
            //SeleniumKeywords.Click(pageName, "diet_3servings_fish");
            //SeleniumKeywords.Click(pageName, "diet_yes_continueeatinghabits");
            SeleniumKeywords.IframeScrollDown();
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
Ejemplo n.º 25
0
        public void TC_ValidateTrackerIncentiveHistory()
        {
            Common config = new Common();

            isenabled = config.GetConfig("IncentiveEnabled").ElementAt(0)[1].ToLower();
            if (isenabled.Equals("false"))
            {
                Assert.Ignore("Incentives not enabled for client");
            }

            string          category             = "I Tracked My Maintain Weight";
            List <string[]> incentivehistorydata = CSVReaderDataTable.GetCSVData("IncentiveHistoryData", pageName, category, GlobalVariables.clientname.ToLower());

            if (incentivehistorydata.Count > 0)
            {
                Page_EligibleActivities peligible = new Page_EligibleActivities(softassertions);
                is_soft_assert = true;

                CommonApi cma   = new CommonApi();
                String    token = cma.GetToken();
                peligible.InitializeIncentiveHistoryRequest();

                peligible.SetHeader(token);
                peligible.SetMethod();
                peligible.SendRequest();

                peligible.VerifyHistoryData(incentivehistorydata, category);
                softassertions.AssertAll();
            }
            else
            {
                Assert.Ignore("Incentives for Tracker is not available for Client");
            }
        }
        public void TC_VerifyAnnouncements()
        {
            List <string[]>    announcementdata = CSVReaderDataTable.GetCSVData("AnnouncementContent", className, "new_member_announcements", GlobalVariables.clientname.ToLower());
            Page_Announcements pannounce        = new Page_Announcements(softassertions);

            pannounce.FetchAnnouncements(announcementdata);
            softassertions.AssertAll();
        }
Ejemplo n.º 27
0
        private void InputCurrentWeight()
        {
            List <string[]> goaldata = CSVReaderDataTable.GetCSVData("InputDataContent", pageName, "weightgoaldata");

            int weightvalue = Convert.ToInt32(goaldata.ElementAt(0)[4]);

            SeleniumKeywords.SetText(pageName, "weighttb", weightvalue.ToString());
        }
Ejemplo n.º 28
0
        public void TC_VerifyDevicesAndAppsSubMenuOptions()
        {
            List <string[]> isEnabled = cmn.GetConfig("FitnessDevice", "NutritionApp");

            fitnessEnabled   = isEnabled.ElementAt(0)[1].ToLower();
            nutritionEnabled = isEnabled.ElementAt(0)[2].ToLower();
            if (fitnessEnabled.Equals("false") && nutritionEnabled.Equals("false"))
            {
                Assert.Ignore("Device and Apps not available for Client");
            }
            //Page_Login plogin = new Page_Login();
            //plogin.Login();

            //Page_HAPrompt haprompt = new Page_HAPrompt();
            //haprompt.GoToDashboard();
            if (GlobalVariables.clientname.ToLower().Equals("dollar general"))
            {
                Assert.Ignore("Feature not availabe for the client");
            }
            else
            {
                cmn.ClickDevicesAndApps();

                int             optionno      = 47;
                Page_Dashboard  dashbrd       = new Page_Dashboard(softassertions);
                List <String[]> devicesubmenu = CSVReaderDataTable.GetCSVData("LeftSubmenuContent", pageName, "devicesandappssubmenu", "allclients");
                dashbrd.Verify_LeftSubMenuOptions(devicesubmenu, optionno);

                List <String[]> specific_devicesandappssubmenu = CSVReaderDataTable.GetCSVData("LeftSubmenuContent", pageName, "specific_devicesandappssubmenu");
                dashbrd.Verify_LeftSubMenuOptions(specific_devicesandappssubmenu, optionno);

                //if (GlobalVariables.clientname.ToLower().Equals("health trust"))
                //{
                //    devicesubmenu = CSVReaderDataTable.GetCSVData("LeftmenuContent", pageName, "orderdevice_devicesandapppssubmenu", "Common"); ;
                //    dashbrd.Verify_LeftSubMenuOptions(devicesubmenu, optionno);
                //}

                //if (!(GlobalVariables.clientname.ToLower().Equals("nucor")))
                //{
                //    devicesubmenu = CSVReaderDataTable.GetCSVData("LeftmenuContent", pageName, "myfitness_devicesandapppssubmenu", "Common"); ;
                //    dashbrd.Verify_LeftSubMenuOptions(devicesubmenu, optionno);
                //}

                //if (!(GlobalVariables.clientname.ToLower().Equals("comprehensivecoaching")) || !(GlobalVariables.clientname.ToLower().Equals("opt out satc")) || !(GlobalVariables.clientname.ToLower().Equals("physical activity")) || !(GlobalVariables.clientname.ToLower().Equals("self directed")) || !(GlobalVariables.clientname.ToLower().Equals("weight management")) || !(GlobalVariables.clientname.ToLower().Equals("first fleet")))
                //{
                //    devicesubmenu = CSVReaderDataTable.GetCSVData("LeftmenuContent", pageName, "mynutrition_devicesandapppssubmenu", "Common"); ;
                //    dashbrd.Verify_LeftSubMenuOptions(devicesubmenu, optionno);
                //}



                cmn.CloseHamMenu();

                is_soft_assert = true;
                softassertions.AssertAll();
            }
        }
        public void TC_DashboardHeader()
        {
            List <string[]> dashboardui = new List <string[]>();

            dashboardui = CSVReaderDataTable.GetCSVData("MobileDashboardData", pageName, "headerelements");
            Page_MDashboard headerUi = new Page_MDashboard(softassertions);

            headerUi.VerifyDashboardHeader(dashboardui);
            softassertions.AssertAll();
        }
Ejemplo n.º 30
0
        public void VerifyEligibleActivities()
        {
            int             length;
            string          ClientName             = GlobalVariables.clientname.ToLower();
            List <string[]> eligibleactivitiesdata = CSVReaderDataTable.GetCSVData("EligibleActivitiesData", pageName, "newmembereligibleactivities", ClientName);

            string[]        actions = { "Url", "ButtonText" };
            object[]        matrix  = { "Title", "Description", "Points", "IncentiveSymbol", "FrequencyCount", "FrequencyDenomination", "LockedForGateKeeper", "GateKeeperText", "CanEarnText", "Actions", actions };
            List <string[]> result  = ApiKeywords.ParseEligibleActivitiesResponse(jsonresponse, matrix);

            Console.WriteLine("Result Count : " + result.Count);
            Console.WriteLine("Eligible Activites Count : " + eligibleactivitiesdata.Count);
            for (int i = 0; i < result.Count; i++)
            {
                foreach (string s in result.ElementAt(i))
                {
                    Console.Write("Value : " + s + "\t");
                }
                Console.WriteLine();
            }

            if (result.Count() != 0 && eligibleactivitiesdata.Count() != 0)
            {
                if (eligibleactivitiesdata.Count() < result.Count())
                {
                    length = eligibleactivitiesdata.Count();
                }
                else
                {
                    length = result.Count();
                }
                for (int i = 0; i < length; i++)
                {
                    int    expstartindex = 4;
                    string elementname   = eligibleactivitiesdata.ElementAt(i)[3];
                    for (int j = 0; j < result.ElementAt(i).Count(); j++)
                    {
                        string expectedtext = eligibleactivitiesdata.ElementAt(i)[expstartindex];
                        string actualtext   = result.ElementAt(i)[j];
                        expstartindex++;
                        Console.WriteLine("Element Name : " + elementname + "\tExpectedText : " + expectedtext + "\tActualText : " + actualtext);
                        softAssertions.Add(elementname, expectedtext, actualtext, "contains");
                        //if (journeydata.Count() < result.Count())
                        //    softAssertions.Add(elementname, "", actualtext, "not equals");
                        //else
                        //    softAssertions.Add(elementname, expectedtext, "", "not equals");
                    }
                }
            }
            else
            {
                softAssertions.Add("Activities count doesn't match", eligibleactivitiesdata.Count(), result.Count(), "equals");
            }
        }