示例#1
0
        /// <summary>
        /// Method verified the new members journey recommendations
        /// </summary>
        /// <param name="journeydata"></param>
        public void VerifyNewMemberJourney(List <string[]> journeydata)
        {
            Console.WriteLine("Total Count: " + journeydata.Count());
            int no_of_tiles_in_a_page = 6;
            int index = 0;

            for (int i = 0; i < journeydata.Count; i = i + 6)
            {
                if ((i % no_of_tiles_in_a_page) == 0)
                {
                    Console.WriteLine("divisible by 6");
                    for (int j = 0; j < no_of_tiles_in_a_page; j++)
                    {
                        Console.WriteLine("Here index : " + index);
                        string elementname            = journeydata.ElementAt(index)[2];
                        string elementlocatorname     = journeydata.ElementAt(index)[3];
                        bool   elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index)[4]);
                        string varvalue1 = journeydata.ElementAt(index)[5];
                        string varvalue2 = journeydata.ElementAt(index)[6];
                        Console.WriteLine("varvalue1 : " + varvalue1 + ",, varvalue2 : " + varvalue2);
                        bool actualelementpresent;
                        if (elementdisplayedstatus == true)
                        {
                            actualelementpresent = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname, varvalue1, varvalue2);
                        }
                        else
                        {
                            actualelementpresent = SeleniumKeywords.IsElementNotPresent(pageName, elementlocatorname, varvalue1, varvalue2);
                        }
                        softAssertions.Add(index + "   Element : " + elementname, elementdisplayedstatus, actualelementpresent, "equals");
                        index++;
                        //System.Threading.Thread.Sleep(3000);
                    }
                    if ((i + no_of_tiles_in_a_page) < (journeydata.Count - 1))
                    {
                        Console.WriteLine(journeydata.Count.ToString() + "," + (i + no_of_tiles_in_a_page).ToString());
                        SeleniumKeywords.Click(pageName, "journeyslidernextbtn");
                        //System.Threading.Thread.Sleep(3000);
                    }
                }
                else
                {
                    Console.WriteLine("Not divisible by 6");
                    int no_of_rest_tiles = i % no_of_tiles_in_a_page;

                    for (int j = 0; j < no_of_rest_tiles; j++)
                    {
                        Console.WriteLine("There index : " + index);
                        string elementname            = journeydata.ElementAt(index)[2];
                        string elementlocatorname     = journeydata.ElementAt(index)[3];
                        bool   elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index)[4]);
                        string varvalue1      = journeydata.ElementAt(index)[5];
                        string varvalue2      = journeydata.ElementAt(index)[6];
                        bool   elementpresent = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname, varvalue1, varvalue2);
                        softAssertions.Add("Element : " + elementname, elementdisplayedstatus, elementpresent, "equals");
                        index++;
                    }
                }
            }
        }
示例#2
0
        /// <summary>
        /// Method is use to verify sub menu option
        /// </summary>
        /// <param name="expected"></param>
        /// <param name="count"></param>
        public void Verify_LeftSubMenuOptions(List <String[]> expected, int count)
        {
            bool   actualdisplaystatus;
            bool   expecteddisplaystatus;
            string elementname, locatorname;
            string locatorindex1, locatorindex2;
            string enabled, clientname;

            for (int i = 0; i < expected.Count; i++)
            {
                clientname            = expected.ElementAt(i)[0];
                enabled               = expected.ElementAt(i)[3];
                elementname           = expected.ElementAt(i)[4];
                locatorname           = expected.ElementAt(i)[5];
                expecteddisplaystatus = Convert.ToBoolean(expected.ElementAt(i)[6]);
                locatorindex1         = expected.ElementAt(i)[7];
                locatorindex2         = expected.ElementAt(i)[8];

                if (clientname.ToLower().Equals("allclients") || FeatureEnabledForCurrentClient(enabled, clientname))
                {
                    if (expecteddisplaystatus == true)
                    {
                        actualdisplaystatus = SeleniumKeywords.IsElementPresent(pageName, locatorname, locatorindex1, locatorindex2);
                    }
                    else
                    {
                        actualdisplaystatus = SeleniumKeywords.IsElementNotPresent(pageName, locatorname, locatorindex1, locatorindex2);
                    }

                    softAssertion.Add(elementname, expecteddisplaystatus, actualdisplaystatus, "equals");
                }
            }
        }
示例#3
0
        /// <summary>
        /// Verified recommendations in journey banner
        /// </summary>
        /// <param name="journeydata"></param>
        public void VerifyJourneyBanner(List <string[]> journeydata)
        {
            int no_of_tiles_in_a_page = 3;
            int index = 0;

            for (int i = 0; i < (journeydata.Count / 2); i = i + 3)
            {
                if ((i % no_of_tiles_in_a_page) == 0)
                {
                    Console.WriteLine("divisible by 3");
                    for (int j = 0; j < no_of_tiles_in_a_page; j++)
                    {
                        Console.WriteLine("Here index : " + index);
                        string elementname = journeydata.ElementAt(index * 2)[2];
                        //string elementlocatorname = journeydata.ElementAt(index)[3];
                        bool   elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index * 2)[4]);
                        string varvalue1 = journeydata.ElementAt(index * 2)[5];
                        Console.WriteLine("varvalue1 : " + varvalue1);
                        bool actualelementpresent;
                        if (elementdisplayedstatus == true)
                        {
                            actualelementpresent = SeleniumKeywords.IsElementPresent(pageName, "bannertile", varvalue1);
                        }
                        else
                        {
                            actualelementpresent = SeleniumKeywords.IsElementNotPresent(pageName, "bannertile", varvalue1);
                        }
                        softAssertions.Add(index + "   Element : " + elementname, elementdisplayedstatus, actualelementpresent, "equals");
                        index++;
                        //System.Threading.Thread.Sleep(3000);
                    }
                    if ((i + 3) < ((journeydata.Count / 2) - 1))
                    {
                        SeleniumKeywords.Click(pageName, "bannernextbtn");
                        //System.Threading.Thread.Sleep(3000);
                    }
                }
                else
                {
                    Console.WriteLine("Not divisible by 3");
                    int no_of_rest_tiles = i % no_of_tiles_in_a_page;

                    for (int j = 0; j < no_of_rest_tiles; j++)
                    {
                        Console.WriteLine("There index : " + index);
                        string elementname            = journeydata.ElementAt(index * 2)[2];
                        string elementlocatorname     = journeydata.ElementAt(index * 2)[3];
                        bool   elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index * 2)[4]);
                        string varvalue1      = journeydata.ElementAt(index * 2)[5];
                        bool   elementpresent = SeleniumKeywords.IsElementPresent(pageName, "bannertile", varvalue1);
                        softAssertions.Add("Element : " + elementname, elementdisplayedstatus, elementpresent, "equals");
                        index++;
                    }
                }
            }
        }
示例#4
0
        public void Verify_LeftMenuCommonOptions(List <String[]> expected)
        {
            bool   actualdisplaystatus;
            bool   expecteddisplaystatus;
            string elementname, locatorname;
            string locatorindex1;

            //Console.WriteLine("Verify_LeftMenuCommonOptions moducle called");
            for (int i = 0; i < expected.Count; i++)
            {
                elementname           = expected.ElementAt(i)[3];
                locatorname           = expected.ElementAt(i)[4];
                expecteddisplaystatus = Convert.ToBoolean(expected.ElementAt(i)[5]);
                locatorindex1         = expected.ElementAt(i)[6];
                // locatorindex2 = expected.ElementAt(i)[7];
                Console.WriteLine(elementname + "  " + locatorname + "  " + locatorindex1);
                if (expecteddisplaystatus == true)
                {
                    //if ((locatorindex1.ToLower().Equals("financial well-being")) && ((GlobalVariables.clientname.ToLower().Equals("spouses")) || (GlobalVariables.clientname.ToLower().Equals("onlife health"))|| (GlobalVariables.clientname.ToLower().Equals("dollar general")) || (GlobalVariables.clientname.ToLower().Equals("group 44"))))
                    //{
                    //    actualdisplaystatus = true;
                    //}
                    //else if((locatorindex1.ToLower().Equals("devices and apps")) && (GlobalVariables.clientname.ToLower().Equals("dollar general")))
                    //{
                    //    actualdisplaystatus = true;
                    //}
                    //else
                    //{
                    actualdisplaystatus = SeleniumKeywords.IsElementPresent(pageName, locatorname, locatorindex1);
                    //}
                }
                else
                {
                    actualdisplaystatus = SeleniumKeywords.IsElementNotPresent(pageName, locatorname, locatorindex1);
                }

                //Console.WriteLine("The Actual menu option title: " + actualdisplaystatus + "  Expected  :" + expected.ElementAt(i)[4]);
                softAssertion.Add(elementname, expecteddisplaystatus, actualdisplaystatus, "equals");
                //Console.WriteLine("Pro get count   " + count);
                //System.Threading.Thread.Sleep(1000);
            }
        }
示例#5
0
        /// <summary>
        /// Verify Buttons are displayed on the User Agreement Page
        /// </summary>
        private void VerifyUAButtonsDisplayed()
        {
            bool status;

            // Verify Cancel button displayed
            status = SeleniumKeywords.IsElementPresent(pageName, "uacancelbtn");
            softAssertion.Add("Cancel Button", true, status, "equals");

            //Verify Back Button displayed
            status = SeleniumKeywords.IsElementPresent(pageName, "uabackbtn");
            softAssertion.Add("Back Button", true, status, "equals");

            //Verify Continue button not displayed
            status = SeleniumKeywords.IsElementNotPresent(pageName, "uacontinuebtn");
            softAssertion.Add("Continue Button before Checkbox", false, status, "equals");

            //Click Agreement check box
            SeleniumKeywords.Click(pageName, "uacheckbx");

            //Verify Continue button displayed
            status = SeleniumKeywords.IsElementPresent(pageName, "uacontinuebtn");
            softAssertion.Add("Continue Button after Checkbox", true, status, "equals");
        }
示例#6
0
        /// <summary>
        /// Method verifies Journey and Recommendations after completing HA
        /// </summary>
        public void VerifyJournerWithRecommendation()
        {
            List <string[]> journeydata           = CSVReaderDataTable.GetCSVData("JourneyContent", "Page_FillHA", "highrisk_journeyrecommendation");
            int             no_of_tiles_in_a_page = 6;
            int             index           = 0;
            int             divisiblelength = journeydata.Count / 6;

            Console.WriteLine("Journey data length : " + journeydata.Count);
            for (int i = 0; i < divisiblelength; i++)
            {
                //if((i % no_of_tiles_in_a_page) == 0)
                //{
                Console.WriteLine("divisible by 6");
                for (int j = 0; j < no_of_tiles_in_a_page; j++)
                {
                    Console.WriteLine("Here index : " + index);
                    string elementname            = journeydata.ElementAt(index)[2];
                    string elementlocatorname     = journeydata.ElementAt(index)[3];
                    bool   elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index)[4]);
                    string varvalue1 = journeydata.ElementAt(index)[5];
                    string varvalue2 = journeydata.ElementAt(index)[6];
                    Console.WriteLine("varvalue1 : " + varvalue1 + ", varvalue2 : " + varvalue2);
                    bool elementpresent = false;
                    if (elementdisplayedstatus == true)
                    {
                        elementpresent = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname, varvalue1, varvalue2);
                    }
                    else if (elementdisplayedstatus == false)
                    {
                        elementpresent = SeleniumKeywords.IsElementNotPresent(pageName, elementlocatorname, varvalue1, varvalue2);
                    }

                    softAssertions.Add(index + "   Element : " + elementname, elementdisplayedstatus, elementpresent, "equals");
                    index++;
                    System.Threading.Thread.Sleep(3000);
                }
                if ((i + no_of_tiles_in_a_page) < (journeydata.Count - 1))
                {
                    SeleniumKeywords.Click(pageName, "journeyslidernextbtn");
                    System.Threading.Thread.Sleep(3000);
                }

                //}
                //else
                //{
                //    Console.WriteLine("Not divisible by 6");
                //    int no_of_rest_tiles = i % no_of_tiles_in_a_page;

                //    for (int j = 0; j < no_of_rest_tiles; j++)
                //    {
                //        Console.WriteLine("There index : " + index);
                //        string elementname = journeydata.ElementAt(index)[2];
                //        string elementlocatorname = journeydata.ElementAt(index)[3];
                //        bool elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index)[4]);
                //        string varvalue1 = journeydata.ElementAt(index)[5];
                //        string varvalue2 = journeydata.ElementAt(index)[6];
                //        bool elementpresent = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname, varvalue1, varvalue2);
                //        softAssertions.Add("Element : " + elementname, elementdisplayedstatus, elementpresent, "equals");
                //        index++;
                //    }
                //}
            }
            for (int i = index; i < journeydata.Count; i++)
            {
                Console.WriteLine("There index : " + index);
                string elementname            = journeydata.ElementAt(index)[2];
                string elementlocatorname     = journeydata.ElementAt(index)[3];
                bool   elementdisplayedstatus = Convert.ToBoolean(journeydata.ElementAt(index)[4]);
                string varvalue1      = journeydata.ElementAt(index)[5];
                string varvalue2      = journeydata.ElementAt(index)[6];
                bool   elementpresent = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname, varvalue1, varvalue2);
                softAssertions.Add("Element : " + elementname, elementdisplayedstatus, elementpresent, "equals");
                index++;
            }
        }
 private Boolean NotRecommendedCoachingAfterHA(String Coachingname)
 {
     return(SeleniumKeywords.IsElementNotPresent(pageName, "coaching_recommended", Coachingname));
 }
示例#8
0
 private Boolean NotRecommandedTrackerAfterHA(String trackername)
 {
     return(SeleniumKeywords.IsElementNotPresent(pageName, "tracker_recommended", trackername));
 }