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[]> 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;
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// enter creditioals of fitbit device
 /// </summary>
 private void EnterLoginDetails()
 {
     System.Threading.Thread.Sleep(10000);
     //SeleniumKeywords.Click(pageName, "fitbit_email_txt");
     SeleniumKeywords.SetText(pageName, "fitbit_email_txt", "*****@*****.**");
     SeleniumKeywords.SetText(pageName, "fitbit_pass_txt", "Password1");
 }
 private void fillUserDetails()
 {
     SeleniumKeywords.SetText(pageName, "forgotuname_firstname", GlobalVariables.firstname);
     SeleniumKeywords.SetText(pageName, "forgotuname_lastname", GlobalVariables.lastname);
     SeleniumKeywords.SetText(pageName, "forgotuname_dob", GlobalVariables.dob);
     SeleniumKeywords.SetText(pageName, "forgotuname_zipcode", GlobalVariables.zipcode);
 }
 private void FillProgressCheckIn()
 {
     Console.WriteLine("Switching to iframe ..... ");
     System.Threading.Thread.Sleep(8000);
     SeleniumKeywords.NavigateToIFrame("assessmentFrame");
     System.Threading.Thread.Sleep(12000);
     SeleniumKeywords.Click(pageName, "fruitconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "fruitjuicestatusradiobtn");
     SeleniumKeywords.Click(pageName, "vegetablesconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "DietVegiecontainsradiobtn");
     SeleniumKeywords.Click(pageName, "grainsconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "wholegrainsconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "dairyprodconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "poultryconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "unsaturatedfatconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "saturatedfatconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "sodiumconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "sugarconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "alcoholconsumeradiobtn");
     SeleniumKeywords.Click(pageName, "currentweightsatisfactionstatusradiobtn");
     SeleniumKeywords.SetText(pageName, "currentweighttb", "180");
     SeleniumKeywords.SetText(pageName, "heightinfeettb", "5");
     SeleniumKeywords.SetText(pageName, "heightininchtb", "5");
     SeleniumKeywords.SetText(pageName, "modactivityhrstb", "5");
     SeleniumKeywords.SetText(pageName, "modactivitymintb", "5");
     SeleniumKeywords.SetText(pageName, "vigactivityhrstb", "5");
     SeleniumKeywords.SetText(pageName, "vigactivitymintb", "5");
     SeleniumKeywords.Click(pageName, "improvinghabitstatusradiobtn");
     SeleniumKeywords.Click(pageName, "wellbalancedliferadiobtn");
     SeleniumKeywords.Click(pageName, "wellbalancedeatingradiobtn");
     SeleniumKeywords.Click(pageName, "challengeeatingcheckbox");
     SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn"); //Click on 'Continue' button
 }
        /// <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>
 /// Method to send Connection Request
 /// </summary>
 /// <param name="email"></param>
 private void SendConnectionRequest(string email)
 {
     Thread.Sleep(2000);
     //JavaScriptKeywords.SetTextInElement(pageName, "connectionstextbox", email);
     SeleniumKeywords.SetText(pageName, "connectionstextbox", email);
     SeleniumKeywords.Click(pageName, "searchbtn");
 }
        /// <summary>
        /// This method will fill Progress Check In Questionnaire
        /// then submit form by clicking 'continue' button
        /// </summary>
        private void FillProgressCheckIn()
        {
            Console.WriteLine("Switching to iframe ..... ");
            System.Threading.Thread.Sleep(4000);
            SeleniumKeywords.NavigateToIFrame("assessmentFrame");

            System.Threading.Thread.Sleep(5000);

            //Fill ProgressCheckIn questionnaire
            SeleniumKeywords.SetText(pageName, "heightfeettxt", "4");            //Fill height in feet
            SeleniumKeywords.SetText(pageName, "heightinchestxt", "10");         //Fill height in inches
            SeleniumKeywords.SetText(pageName, "weightpoundstxt", "380");        //Fill weight in pounds
            SeleniumKeywords.SetText(pageName, "waistinchestxt", "40");          //Fill waist in inches
            SeleniumKeywords.Click(pageName, "dietarylotsofimprovementradio");   //Select 'lots of improvement' for dietary
            SeleniumKeywords.SetText(pageName, "moderatehourstxt", "0");         //Fill moderate hours
            SeleniumKeywords.SetText(pageName, "moderateminstxt", "0");          //Fill moderate minutes
            SeleniumKeywords.SetText(pageName, "vigoroushourstxt", "0");         //Fill vigorous hours
            SeleniumKeywords.SetText(pageName, "vigorousmintxt", "0");           //Fill vigorous minutes
            SeleniumKeywords.Click(pageName, "currentloseweightradio");          //Select 'lose weight'
            SeleniumKeywords.Click(pageName, "manageweightyesradio");            //Select 'yes' for manage weight
            SeleniumKeywords.Click(pageName, "beginrightnowradio");              //Select 'right now'
            SeleniumKeywords.Click(pageName, "confidentyesradio");               //Select 'yes'
            SeleniumKeywords.Click(pageName, "dietschallengecheckbx");           //Check 'diets'
            SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn"); //Click on 'Continue' button
        }
        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);
        }
Exemplo n.º 11
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());
        }
 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);
 }
 private void FillFeedbackForm()
 {
     SeleniumKeywords.Click(pageName, "contentexcellentrb");
     SeleniumKeywords.Click(pageName, "designexcellentrb");
     SeleniumKeywords.Click(pageName, "usabilityexcellentrb");
     SeleniumKeywords.Click(pageName, "overallexcellentrb");
     SeleniumKeywords.SetText(pageName, "commenttxtarea", "Performing Automated Test");
     SeleniumKeywords.Click(pageName, "submitbtn");
     SeleniumKeywords.Click(pageName, "closebtn");
 }
Exemplo n.º 14
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);
 }
Exemplo n.º 16
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;
            }
        }
        /// <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);
            }
        }
        /// <summary>
        /// Method to fill first moduel of the HA
        /// </summary>
        /// <param name="mid"></param>
        private void FillYourInfoModule(string mid)
        {
            List <string[]> normalHadata = new List <string[]>();

            normalHadata = CSVReaderDataTable.GetCSVData("HAData", pageName, "yourinfo");
            Console.WriteLine("NormalHAdata count: " + normalHadata.Count);
            //SeleniumKeywords.NavigateToIFrame("assessmentFrame");

            DataTable responsetbl = FetchResponseInfo(mid);

            for (int i = 0; i < normalHadata.Count; i++)
            {
                string qtext      = normalHadata.ElementAt(i)[3];
                string rtext      = normalHadata.ElementAt(i)[4];
                string inputdata  = normalHadata.ElementAt(i)[5];
                string searchcrit = "RText = '" + rtext + "' and QText like '%" + qtext + "%'";
                string rid;
                string typedesc;
                // Use the Select method to find all rows matching the filter.
                DataRow[] foundRows = responsetbl.Select(searchcrit);

                // Print column 0 of each returned row.
                for (int j = 0; j < foundRows.Length; j++)
                {
                    Console.WriteLine("Data found for following search criteria");
                    Console.WriteLine(foundRows[j][0] + " | " + foundRows[j][1] + " | " + foundRows[j][2] + " | " + foundRows[j][3] + " | " + foundRows[j][4] + " | " + foundRows[j][5] + " | " + foundRows[j][6]);

                    rid      = foundRows[j][0].ToString();
                    typedesc = foundRows[j][4].ToString();

                    if (typedesc.ToLower().Equals("radiobutton"))
                    {
                        SeleniumKeywords.Click(pageName, "responseid", rid);
                    }

                    else if (typedesc.ToLower().Equals("textbox"))
                    {
                        SeleniumKeywords.SetText(pageName, "responseid", inputdata, rid);
                    }
                }
            }
            SeleniumKeywords.Click(pageName, "saveandcontinuebtn");
        }
Exemplo n.º 19
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;
            }
        }
Exemplo n.º 20
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;
            }
        }
 private void FillProgressCheckIn()
 {
     Console.WriteLine("Switching to iframe ..... ");
     System.Threading.Thread.Sleep(8000);
     SeleniumKeywords.NavigateToIFrame("assessmentFrame");
     System.Threading.Thread.Sleep(12000);
     SeleniumKeywords.SetText(pageName, "modhrsacticitytb", "5");
     SeleniumKeywords.SetText(pageName, "modminacticitytb", "5");
     SeleniumKeywords.SetText(pageName, "vighrsacticitytb", "1");
     SeleniumKeywords.SetText(pageName, "vigminacticitytb", "10");
     SeleniumKeywords.Click(pageName, "musclebuildingstatusradiobtn");
     SeleniumKeywords.IframeScrollDown();
     Thread.Sleep(2000);
     SeleniumKeywords.Click(pageName, "stretchingstatusradiobtn");
     SeleniumKeywords.Click(pageName, "durationhealthylevelradiobtn");
     SeleniumKeywords.Click(pageName, "statusofphysicalactivityradiobtn");
     SeleniumKeywords.Click(pageName, "confidencelevelmaintainactivityradiobtn");
     SeleniumKeywords.IframeScrollDown();
     Thread.Sleep(2000);
     SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn"); //Click on 'Continue' button
 }
Exemplo n.º 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;
            }
        }
        private void FillProgressCheckIn()
        {
            Console.WriteLine("Switching to iframe ..... ");
            System.Threading.Thread.Sleep(8000);
            SeleniumKeywords.NavigateToIFrame("assessmentFrame");
            System.Threading.Thread.Sleep(12000);
            SeleniumKeywords.SetText(pageName, "heightfeettb", "5");
            SeleniumKeywords.SetText(pageName, "heightinchtb", "5");
            SeleniumKeywords.SetText(pageName, "weighttb", "180");
            SeleniumKeywords.SetText(pageName, "waistinchtb", "36");

            SeleniumKeywords.Click(pageName, "doctorstatusradiobtn");
            SeleniumKeywords.Click(pageName, "fluvaccinationradiobtn");
            SeleniumKeywords.Click(pageName, "fluupdateradiobtn");
            //SeleniumKeywords.Click(pageName, "asprindailyradiobtn");

            SeleniumKeywords.Click(pageName, "coloretralscreenradiobtn");
            SeleniumKeywords.Click(pageName, "typeofscreenradiobtn");
            SeleniumKeywords.Click(pageName, "bloodpressuremeasureradiobtn");
            SeleniumKeywords.Click(pageName, "cholesterolmeasureradiobtn");
            //SeleniumKeywords.Click(pageName, "mammogrammeasureradiobtn");
            //SeleniumKeywords.Click(pageName, "papsmearmmeasureradiobtn");
            //SeleniumKeywords.Click(pageName, "bonedensityradiobtn");
            //JavaScriptKeywords.ScrollToAnElement(pageName, "cigaretteradiobtn");

            SeleniumKeywords.Click(pageName, "cigaretteradiobtn");
            SeleniumKeywords.Click(pageName, "pipesradiobtn");
            SeleniumKeywords.Click(pageName, "cigarradiobtn");
            SeleniumKeywords.Click(pageName, "smokelessradiobtn");
            SeleniumKeywords.Click(pageName, "secondhandsmokeradiobtn");
            SeleniumKeywords.SetText(pageName, "modacthrstb", "5");
            SeleniumKeywords.SetText(pageName, "modactmintb", "25");
            SeleniumKeywords.SetText(pageName, "vigacthrstb", "2");
            SeleniumKeywords.SetText(pageName, "vigactmintb", "10");
            SeleniumKeywords.Click(pageName, "fruitconsumeradiobtn");
            SeleniumKeywords.Click(pageName, "vegconsumeradiobtn");
            SeleniumKeywords.Click(pageName, "drinkstatusradiobtn");
            SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn"); //Click on 'Continue' button
        }
Exemplo n.º 24
0
 private void FillProgressCheckIn()
 {
     Console.WriteLine("Switching to iframe ..... ");
     System.Threading.Thread.Sleep(8000);
     SeleniumKeywords.NavigateToIFrame("assessmentFrame");
     System.Threading.Thread.Sleep(12000);
     SeleniumKeywords.SetText(pageName, "heightfeettb", "5");
     SeleniumKeywords.SetText(pageName, "heightinchtb", "10");
     SeleniumKeywords.SetText(pageName, "weighttb", "180");
     SeleniumKeywords.Click(pageName, "highbloodpressurestatusradiobtn");
     SeleniumKeywords.SetText(pageName, "systolictb", "120");
     SeleniumKeywords.SetText(pageName, "diastolictb", "80");
     SeleniumKeywords.Click(pageName, "diabetesstatusradiobtn");
     SeleniumKeywords.Click(pageName, "alcoholstatusradiobtn");
     SeleniumKeywords.SetText(pageName, "modacthourstb", "6");
     SeleniumKeywords.SetText(pageName, "modactmintb", "40");
     SeleniumKeywords.SetText(pageName, "vigoroushourstb", "2");
     SeleniumKeywords.SetText(pageName, "vigorousmintb", "15");
     SeleniumKeywords.Click(pageName, "fruitsstatusradiobtn");
     SeleniumKeywords.Click(pageName, "vegitablestatusradiobtn");
     SeleniumKeywords.Click(pageName, "dairystatusradiobtn");
     SeleniumKeywords.Click("CommonProgressCheckIn", "framecontinuebtn"); //Click on 'Continue' button
 }
 private void InputMessage(string message)
 {
     SeleniumKeywords.SetText(pageName, "messagebox", message);
 }
Exemplo n.º 26
0
 private void setstatusmessage()
 {
     SeleniumKeywords.SetText(pageName, "statusmessage_textarea", "I am Rocking");
 }
Exemplo n.º 27
0
        /// <summary>
        /// Set valid mobile number in Mobile Field
        /// </summary>
        private void SetMobileNumber()
        {
            string mobilenumber = CommonUtilityKeywords.RandomUSNumberGenerator();

            SeleniumKeywords.SetText(pageName, "alwayson_phnnum_txtbx", mobilenumber);
        }
Exemplo n.º 28
0
 /// <summary>
 /// Enter valid primary phone number
 /// </summary>
 private void EnterValidPrimPhNum()
 {
     SeleniumKeywords.SetText(pageName, "loginpref_primaryphnum", "9999999999");
 }
Exemplo n.º 29
0
 private void ConfirmPassword()
 {
     SeleniumKeywords.SetText(pageName, "confirmpwd_textbx", GlobalVariables.password);
 }
Exemplo n.º 30
0
 private void SetPassword()
 {
     SeleniumKeywords.SetText(pageName, "password_textbx", GlobalVariables.password);
 }