public void trackChallenge(List <string[]> historyheader, List <string[]> historydata)
        {
            Common com = new Common();

            com.ClickChallengesMenu();
            if (GlobalVariables.clientname.ToLower().Equals("meabt"))
            {
                SeleniumKeywords.Click(pageName, "submenuchallenges");
            }
            ClickOnInProgressChallenge("The Mindful Bite");
            CommonTracker ct                  = new CommonTracker();
            DateTime      currentdate         = DateTime.Today;
            string        calenderdefaultdate = SeleniumKeywords.GetAttributeValue("Common", "calenderdatepicker", "value");
            string        currentdt           = String.Format("{0:MM/dd/yyyy}", currentdate);

            softAssertion.Add("Date Picker", currentdt, calenderdefaultdate, "equal");
            ClickOnYesBtn();
            JavaScriptKeywords.SetTextByControlId("DataPointDate", com.GetDate()[2]);
            ClickOnUpdateBtn();
            ct.ClickViewHistory();
            ValidateHistoryHeader(historyheader);
            // Step 2: Verify History data
            historydata.ElementAt(0)[4] = Convert.ToDateTime(com.GetDate()[2]).ToString("dddd, MMM dd yyyy");
            ValidateHistoryData(historydata);
        }
예제 #2
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");
        }
예제 #3
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");
        }
예제 #4
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");
        }
        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;
            }
        }
        /// <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;
            }
        }
        /// <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;
            }
        }
        public void ValidateTrackerLatestValues(List <string[]> latestvaluedata)
        {
            string pagename = pageName;

            for (int i = 0; i < latestvaluedata.Count; i++)
            {
                string elementname        = latestvaluedata.ElementAt(i)[2];
                string elementlocatorname = latestvaluedata.ElementAt(i)[3];
                string expectedvalue      = latestvaluedata.ElementAt(i)[4];
                string variablevalue      = latestvaluedata.ElementAt(i)[5];
                //Thread.Sleep(1000);
                string actualvalue = "";
                if (variablevalue.Equals("novalue"))
                {
                    JavaScriptKeywords.ScrollToAnElement("CommonTracker", elementlocatorname);
                    actualvalue = SeleniumKeywords.GetText("CommonTracker", elementlocatorname);
                }
                else
                {
                    JavaScriptKeywords.ScrollToAnElement("CommonTracker", elementlocatorname, variablevalue);
                    actualvalue = SeleniumKeywords.GetText("CommonTracker", elementlocatorname, variablevalue);
                }


                Console.WriteLine("elementname : " + elementname);
                Console.WriteLine("expectedvalue : " + expectedvalue);
                Console.WriteLine("variablevalue : " + variablevalue);
                Console.WriteLine("actualvalue : " + actualvalue);
                softAssertions.Add("Element : " + elementname, expectedvalue, actualvalue, "contains");
            }
        }
        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);
        }
        private void InputWeight()
        {
            SeleniumKeywords.SetText(pageName, "currentweighttb", "250");

            SeleniumKeywords.SetText(pageName, "goalweighttb", "140");
            tdate = cmn.AddDaysInCurrentDate(20);
            JavaScriptKeywords.SetTextByControlId("DataPointDate", tdate);
        }
 private void InputBPStatus()
 {
     Thread.Sleep(2000);
     SeleniumKeywords.SetText(pageName, "currentsystolictb", "140");
     SeleniumKeywords.SetText(pageName, "currentdiastolictb", "100");
     SeleniumKeywords.SetText(pageName, "goalsystolictb", "120");
     SeleniumKeywords.SetText(pageName, "goaldiastolictb", "80");
     tdate = cmn.AddDaysInCurrentDate(20);
     JavaScriptKeywords.SetTextByControlId("DataPointDate", tdate);
 }
예제 #12
0
        private void FillYourInfoModule()
        {
            //System.Threading.Thread.Sleep(3000);
            List <string[]> haelements = new List <string[]>();

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

            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, "yourinfo_overallhealth");
            //SeleniumKeywords.Click(pageName, "yourinfo_eatinghabits");
            //SeleniumKeywords.Click(pageName, "yourinfo_drinkhabits");
            //SeleniumKeywords.Click(pageName, "yourinfo_smokehabits");
            //SeleniumKeywords.Click(pageName, "yourinfo_cigarhabits");
            //SeleniumKeywords.Click(pageName, "yourinfo_pipeshabits");
            //SeleniumKeywords.Click(pageName, "yourinfo_smokelesshabits");

            //SeleniumKeywords.MoveToElement(pageName, "yourinfo_moderatehours");
            haelements = CSVReaderDataTable.GetCSVData("InputDataContent", pageName, CommonInputDataContentAttributeName);

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

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

            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, "yourinfo_stresseffect");
            //SeleniumKeywords.Click(pageName, "yourinfo_diabeticstatus");
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
            System.Threading.Thread.Sleep(12000);
        }
 private void InputBPStatus()
 {
     SeleniumKeywords.SetText(pageName, "current_totalcholestero_ltb", "250");
     SeleniumKeywords.SetText(pageName, "current_ldl_tb", "100");
     SeleniumKeywords.SetText(pageName, "current_hdl_tb", "55");
     SeleniumKeywords.SetText(pageName, "current_triglycerides_tb", "222");
     SeleniumKeywords.SetText(pageName, "goal_totalcholesterol_tb", "180");
     SeleniumKeywords.SetText(pageName, "goal_ldl_tb", "80");
     SeleniumKeywords.SetText(pageName, "goal_hdl_tb", "65");
     SeleniumKeywords.SetText(pageName, "goal_triglycerides_tb", "140");
     tdate = cmn.AddDaysInCurrentDate(20);
     JavaScriptKeywords.SetTextByControlId("DataPointDate", tdate);
 }
        /// <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, "bpdata");
            List <string[]> historydata     = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryheader");
            List <string[]> latestvaluedata = CSVReaderDataTable.GetCSVData("TrackerContent", pageName, "latestvalues");
            Common          date            = new Common(softAssertions);
            CommonTracker   bp = new CommonTracker(softAssertions);

            date.VerifyDate();

            int sysvalue = Convert.ToInt32(trackerdata.ElementAt(0)[4]);
            int diavalue = Convert.ToInt32(trackerdata.ElementAt(1)[4]);

            for (int i = 0; i <= 2; i++)
            {
                if (i > 0)
                {
                    sysvalue += 10;
                    diavalue += 10;
                }
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(0)[3], sysvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(1)[3], diavalue.ToString());
                JavaScriptKeywords.SetTextByControlId("DataPointDate", date.GetDate()[i]);
                bp.ClickUpdateButton();
                System.Threading.Thread.Sleep(2000);

                bp.ClickViewHistory();
                if (i == 0)
                {
                    bp.ValidateHistoryHeader(historydata, pageName);
                    historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryvalue");
                }
                String historytabledata = Convert.ToDateTime(date.GetDate()[i]).ToString("dddd, MMM dd yyyy") + "|" + sysvalue.ToString() + " / " + diavalue.ToString();
                historydata.ElementAt(0)[4] = historytabledata;
                bp.ValidateHistoryData(historydata, pageName);
            }

            if (trackerfrommenu == true)
            {
                latestvaluedata.ElementAt(1)[4] = sysvalue.ToString() + "/" + diavalue.ToString();
                latestvaluedata.ElementAt(3)[4] = Convert.ToDateTime(date.GetDate()[2]).ToString("MMMM d, yyyy");
                bp.ValidateTrackerLatestValues(latestvaluedata);
            }
        }
예제 #15
0
        private void InputAndUpdateTrackerDataFromGoal()
        {
            List <string[]> trackerdata = CSVReaderDataTable.GetCSVData("InputDataContent", pageName, "tobdata");
            List <string[]> historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryheader");
            Common          date        = new Common(softAssertions);
            CommonTracker   tob         = new CommonTracker(softAssertions);

            date.VerifyDate();

            int changevalueindex = 0;

            int cigvalue   = Convert.ToInt32(trackerdata.ElementAt(0)[4]);
            int cigarvalue = Convert.ToInt32(trackerdata.ElementAt(1)[4]);
            int chewsvalue = Convert.ToInt32(trackerdata.ElementAt(2)[4]);
            int dipsvalue  = Convert.ToInt32(trackerdata.ElementAt(3)[4]);
            int pipesvalue = Convert.ToInt32(trackerdata.ElementAt(4)[4]);

            for (int i = 0; i <= 2; i++)
            {
                SeleniumKeywords.SelectValueFromDropdown(pageName, "tobaccofreedd", "No");
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(0)[3], cigvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(1)[3], cigarvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(2)[3], chewsvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(3)[3], dipsvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(4)[3], pipesvalue.ToString());
                JavaScriptKeywords.SetTextByControlId("DataPointDate", date.GetDate()[i]);
                tob.ClickUpdateButton();
                tob.ClickViewHistory();
                if (i == 0)
                {
                    tob.ValidateHistoryHeader(historydata, pageName);
                    historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryvalue");
                }

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

                tob.ValidateHistoryData(historydata, pageName);
                cigvalue   += 5;
                cigarvalue += 3;
                chewsvalue += 2;
                dipsvalue  += -1;
                pipesvalue += -1;
            }
        }
예제 #16
0
        private void SetStressGoalForFutureDate()
        {
            List <string[]> currentstatus = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "currentstatus");

            for (int i = 0; i < currentstatus.Count; i++)
            {
                string elementname        = currentstatus.ElementAt(i)[2];
                string elementlocatorname = currentstatus.ElementAt(i)[3];
                string expvalue           = currentstatus.ElementAt(i)[4];
                int    widthmultiple      = 1;
                switch (expvalue)
                {
                case "Barely any or none":
                    widthmultiple = 0;
                    break;

                case "A little bit":
                    widthmultiple = 1;
                    break;

                case "Some":
                    widthmultiple = 2;
                    break;

                case "Quite a bit":
                    widthmultiple = 3;
                    break;

                case "A lot":
                    widthmultiple = 4;
                    break;
                }
                System.Threading.Thread.Sleep(5000);
                SeleniumKeywords.MoveAndClickAtSpecificPosition(pageName, elementlocatorname, 4, widthmultiple, 1, 1);
                System.Threading.Thread.Sleep(2000);
            }

            //verify GOAL


            tdate = cmn.AddDaysInCurrentDate(20);
            Console.WriteLine("Goal Date : " + tdate);
            JavaScriptKeywords.SetTextByControlId("DataPointDate", tdate);
        }
예제 #17
0
        /// <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, "nutdata");
            List <string[]> historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryheader");
            Common          date        = new Common(softAssertions);
            CommonTracker   nut         = new CommonTracker(softAssertions);

            date.VerifyDate();

            int fruitvalue   = Convert.ToInt32(trackerdata.ElementAt(0)[4]);
            int vegvalue     = Convert.ToInt32(trackerdata.ElementAt(1)[4]);
            int dairyvalue   = Convert.ToInt32(trackerdata.ElementAt(2)[4]);
            int grainsvalue  = Convert.ToInt32(trackerdata.ElementAt(3)[4]);
            int proteinvalue = Convert.ToInt32(trackerdata.ElementAt(4)[4]);

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

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

                nut.ValidateHistoryData(historydata, pageName);
                fruitvalue   += 5;
                vegvalue     += 4;
                dairyvalue   += 3;
                grainsvalue  += 2;
                proteinvalue += 1;
            }
        }
예제 #18
0
        /// <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, "choldata");
            List <string[]> historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryheader");
            Common          date        = new Common(softAssertions);
            CommonTracker   chol        = new CommonTracker(softAssertions);

            date.VerifyDate();

            int totcholvalue = Convert.ToInt32(trackerdata.ElementAt(0)[4]);
            int ldlvalue     = Convert.ToInt32(trackerdata.ElementAt(1)[4]);
            int hdlvalue     = Convert.ToInt32(trackerdata.ElementAt(2)[4]);
            int trygvalue    = Convert.ToInt32(trackerdata.ElementAt(3)[4]);

            for (int i = 0; i <= 2; i++)
            {
                SeleniumKeywords.RefreshPage();
                System.Threading.Thread.Sleep(3000);
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(0)[3], totcholvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(1)[3], ldlvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(2)[3], hdlvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(3)[3], trygvalue.ToString());
                JavaScriptKeywords.SetTextByControlId("DataPointDate", date.GetDate()[i]);
                chol.ClickUpdateButton();
                chol.ClickViewHistory();
                if (i == 0)
                {
                    chol.ValidateHistoryHeader(historydata, pageName);
                    historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryvalue");
                }

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

                chol.ValidateHistoryData(historydata, pageName);
                totcholvalue += 50;
                ldlvalue     += 30;
                hdlvalue     += 20;
                trygvalue    += -10;
            }
        }
예제 #19
0
        private void FillActivityModule()
        {
            System.Threading.Thread.Sleep(5000);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");
            List <string[]> haelements = new List <string[]>();

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

            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, "activity_morethan1year_healthylevel");
            SeleniumKeywords.IframeScrollDown();
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
예제 #20
0
        private void FillReviewModule()
        {
            // System.Threading.Thread.Sleep(3000);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");

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

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

            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, "atwork_no_currentlyemployed");
            SeleniumKeywords.IframeScrollDown();
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
예제 #21
0
        private void FillTobaccoModule()
        {
            System.Threading.Thread.Sleep(3000);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");

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

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

            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, "tobacco_occasionally_secondhandsmoke");
            SeleniumKeywords.IframeScrollDown();
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
예제 #22
0
        /// <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, "padata");
            List <string[]> historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryheader");
            Common          date        = new Common(softAssertions);
            CommonTracker   pa          = new CommonTracker(softAssertions);

            date.VerifyDate();

            int cardiovalue   = Convert.ToInt32(trackerdata.ElementAt(0)[4]);
            int strengthvalue = Convert.ToInt32(trackerdata.ElementAt(1)[4]);
            int stretchvalue  = Convert.ToInt32(trackerdata.ElementAt(2)[4]);

            for (int i = 0; i <= 2; i++)

            {
                System.Threading.Thread.Sleep(2000);
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(0)[3], cardiovalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(1)[3], strengthvalue.ToString());
                SeleniumKeywords.SetText(pageName, trackerdata.ElementAt(2)[3], stretchvalue.ToString());
                JavaScriptKeywords.SetTextByControlId("DataPointDate", date.GetDate()[i]);
                pa.ClickUpdateButton();
                System.Threading.Thread.Sleep(10000);
                pa.ClickViewHistory();
                if (i == 0)
                {
                    pa.ValidateHistoryHeader(historydata, pageName);
                    historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryvalue");
                }

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

                pa.ValidateHistoryData(historydata, pageName);
                cardiovalue   += 10;
                strengthvalue += 15;
                stretchvalue  += 5;
            }
        }
예제 #23
0
        private void FillAboutYouModule()
        {
            //System.Threading.Thread.Sleep(3000);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");

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

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

            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, "aboutyou_americanindian_racegroup");
            //SeleniumKeywords.Click(pageName, "aboutyou_always_safetybelt");
            //SeleniumKeywords.Click(pageName, "aboutyou_5_10years_screening");
            SeleniumKeywords.IframeScrollDown();
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
예제 #24
0
        private void ClickContinueToGoToDashboard()
        {
            List <string[]> continuebtnelement = new List <string[]>();

            continuebtnelement = CSVReaderDataTable.GetCSVData(inputfilename, pageName, "continuebtntogotodashboard");

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

            //string ha_congratulations_text = SeleniumKeywords.GetText(pageName, "ha_congratulations_text");
            ////bool textmatch = ha_congratulations_text.Contains("CONGRATULATIONS!");
            ////string msg = "Element: HA_Congratulation_Text Expected: CONGRATULATIONS! Actual: " + ha_congratulations_text;
            ////result.Add(new string[] { msg, textmatch.ToString() });
            //softAssertions.Add("Element : ha_congratulations_text", "CONGRATULATIONS!", ha_congratulations_text, "contains");

            //SeleniumKeywords.NavigateToDefaultContent();
            //System.Threading.Thread.Sleep(5000);
            //SeleniumKeywords.Click(pageName, "hacompletedclosebtn");
        }
예제 #25
0
        private void FillYourVitalModule()
        {
            System.Threading.Thread.Sleep(8000);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");

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

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

            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, "yourvitals_1_3years_weightrange");
            //SeleniumKeywords.Click(pageName, "yourvitals_no_highbp");
            //SeleniumKeywords.Click(pageName, "yourvitals_no_highcholesterol");
            SeleniumKeywords.IframeScrollDown();
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
예제 #26
0
        /// <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, "stressdata");
            List <string[]> historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryheader");
            Common          date        = new Common(softAssertions);
            CommonTracker   stress      = new CommonTracker(softAssertions);

            //date.VerifyTimeAndDate();

            int changevalueindex = 0;


            for (int i = 0; i < 3; i++)
            {
                SeleniumKeywords.RefreshPage();
                int widthmultiple = 1;
                switch (trackerdata.ElementAt(i)[4])
                {
                case "Barely any or none":
                    widthmultiple = 0;
                    break;

                case "A little bit":
                    widthmultiple = 1;
                    break;

                case "Some":
                    widthmultiple = 2;
                    break;

                case "Quite a bit":
                    widthmultiple = 3;
                    break;

                case "A lot":
                    widthmultiple = 4;
                    break;
                }
                System.Threading.Thread.Sleep(10000);
                SeleniumKeywords.MoveAndClickAtSpecificPosition(pageName, trackerdata.ElementAt(i)[3], 4, widthmultiple, 1, 1);
                System.Threading.Thread.Sleep(3000);
                string inputdatetime = date.GetTrackerDateTime()[i];
                Console.WriteLine("InputDateTime : " + inputdatetime);
                JavaScriptKeywords.SetTextByControlId("DataPointDate", inputdatetime);
                stress.ClickUpdateButton();
                //System.Threading.Thread.Sleep(3000);
                stress.ClickViewHistory();
                if (i == 0)
                {
                    stress.ValidateHistoryHeader(historydata, pageName);
                    historydata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "trackerhistoryvalue");
                }

                String historytabledata = Convert.ToDateTime(inputdatetime).ToString("dddd, MMM dd yyyy hh:mm tt") + "|" + trackerdata.ElementAt(i)[4];

                //historydata.ElementAt(changevalueindex)[4] = Convert.ToDateTime(date.GetDate()[i]).ToString("dddd, MMM dd yyyy HH:mm tt");
                historydata.ElementAt(0)[4] = historytabledata;
                stress.ValidateHistoryData(historydata, pageName);
            }
        }
 private void InputCurrentTobaccoStatus()
 {
     SeleniumKeywords.SetText(pageName, "currenttobaccostatus", "15");
     tdate = cmn.AddDaysInCurrentDate(20);
     JavaScriptKeywords.SetTextByControlId("DataPointDate", tdate);
 }
        public void SetDate()
        {
            Common cdate = new Common();

            JavaScriptKeywords.SetTextByControlId("DataPointDate", cdate.GetCurrentDate());
        }