Ejemplo n.º 1
0
        private void VerifyMoreResourcesTile(string viewbtn_elementlocatorname, string viewbtn_varinputvalue, string category)
        {
            SeleniumKeywords.Click(pageName, viewbtn_elementlocatorname, viewbtn_varinputvalue);

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

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

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


            System.Threading.Thread.Sleep(4000);

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

                Boolean actual_display_status = SeleniumKeywords.IsElementPresent(pageName, elementlocatorname);
                softAssertions.Add("Element : " + elementname, expected_display_status, actual_display_status.ToString(), "equals");
            }
            Console.WriteLine("Close Current Tab");
            SeleniumKeywords.CloseCurrentTab();
            SeleniumKeywords.SwitchToTab(1);
            Console.WriteLine("Switch to first tab");
        }
        /// <summary>
        /// Verify the health trail challenges page loaded for HCSC groups
        /// </summary>
        /// <returns></returns>

        public Boolean verifyHealthTrait()
        {
            Console.WriteLine("Switch to second tab");
            SeleniumKeywords.SwitchToTab(2);
            Boolean result;

            result = SeleniumKeywords.IsElementPresent(pageName, "healthTrailpageheader");
            Console.WriteLine("Close Current Tab");
            SeleniumKeywords.CloseCurrentTab();
            SeleniumKeywords.SwitchToTab(1);
            Console.WriteLine("Switch to first tab");
            return(result);
        }
        /// <summary>
        /// call by forgot username test case
        /// </summary>
        public string forgotUserName()
        {
            if (GlobalVariables.environment.ToLower() == "sa" || GlobalVariables.environment.ToLower() == "staging" || GlobalVariables.environment.ToLower() == "prod" || GlobalVariables.environment.ToLower() == "production")
            {
                SeleniumKeywords.Click(pageName, "loginbtn");
            }
            SeleniumKeywords.Click(pageName, "forgotunamepasslnk");
            if (GlobalVariables.environment.ToLower() == "sa" || GlobalVariables.environment.ToLower() == "staging" || GlobalVariables.environment.ToLower() == "prod" || GlobalVariables.environment.ToLower() == "production")
            {
                SeleniumKeywords.SwitchToTab(2);
            }
            clickOnForgotUserName();
            clickOnConfirmBtn();
            fillUserDetails();
            clickOnVerifyBtn();
            string username = getUserName();

            setPassword();
            clickOnVerifyBtn();
            return(username);
        }
        /// <summary>
        /// call by forgot Password test case
        /// </summary>
        public void forgotPassword()
        {
            if (GlobalVariables.environment.ToLower() == "sa" || GlobalVariables.environment.ToLower() == "staging" || GlobalVariables.environment.ToLower() == "prod" || GlobalVariables.environment.ToLower() == "production")
            {
                SeleniumKeywords.Click(pageName, "loginbtn");
            }
            SeleniumKeywords.Click(pageName, "forgotunamepasslnk");
            if (GlobalVariables.environment.ToLower() == "sa" || GlobalVariables.environment.ToLower() == "staging" || GlobalVariables.environment.ToLower() == "prod" || GlobalVariables.environment.ToLower() == "production")
            {
                SeleniumKeywords.SwitchToTab(2);
            }
            clickOnForgotPassword();
            clickOnConfirmBtn();
            SetpUsername(GlobalVariables.username);
            clickOnVerifyBtn();
            softAssertion.Add("Email header", true, emailheaderPresent(), "equals");
            string eid = getEmailId();

            softAssertion.Add("Email id of user", GlobalVariables.email, eid, "contains");
            clickOnOK();
            softAssertion.Add("Email id of user", "Onlife", getHomePageTitle(), "contains");
        }
Ejemplo n.º 5
0
        private void VerifyFinancialWellBeingTiles(string clientname)
        {
            List <string[]> finwellbeingviewbtn = new List <string[]>();

            finwellbeingviewbtn = CSVReaderDataTable.GetCSVData("FinancialWellBeingContent", pageName, "tileviewbtn");
            List <string[]> finwellbeingpdfpages = new List <string[]>();

            finwellbeingpdfpages = CSVReaderDataTable.GetCSVData("FinancialWellBeingContent", pageName, "pdfpages");
            List <string[]> finwellbeingpdfcontent = new List <string[]>();

            finwellbeingpdfcontent = CSVReaderDataTable.GetCSVData("FinancialWellBeingContent", pageName, "pdfcontent");

            int len      = finwellbeingviewbtn.Count;
            int totalpdf = len;

            if (clientname.ToLower().Equals("health trust") || clientname.ToLower().Equals("meabt"))
            {
                totalpdf = len - 1;
            }

            Console.WriteLine("Total pdf pages : " + totalpdf);
            for (int i = 0; i < totalpdf; i++)
            {
                string viewbtn_elementname        = finwellbeingviewbtn.ElementAt(i)[2];
                string viewbtn_elementlocatorname = finwellbeingviewbtn.ElementAt(i)[3];
                string viewbtn_varinputvalue      = finwellbeingviewbtn.ElementAt(i)[5];

                SeleniumKeywords.Click(pageName, viewbtn_elementlocatorname, viewbtn_varinputvalue);

                Console.WriteLine("Switch to second tab");
                SeleniumKeywords.SwitchToTab(2);
                System.Threading.Thread.Sleep(5000);

                string actual_page_url = SeleniumKeywords.GetPageUrl();

                string pdfpages_elementname          = finwellbeingpdfpages.ElementAt(i)[2];
                string pdfpages_urlvalue             = finwellbeingpdfpages.ElementAt(i)[3];
                string pdfpages_expected_no_of_pages = finwellbeingpdfpages.ElementAt(i)[4];

                Console.WriteLine("Actual URL : " + actual_page_url);
                Console.WriteLine("Expected URL : " + pdfpages_urlvalue);
                if (actual_page_url.ToLower().Contains(pdfpages_urlvalue.ToLower()))
                {
                    int pdfpages_actual_no_of_pages = utilityKeywords.GetTotalNoOfPagesInPDFFile(actual_page_url);
                    Console.WriteLine("PDF pages : " + pdfpages_actual_no_of_pages);
                    softAssertions.Add("Element : " + pdfpages_elementname, pdfpages_expected_no_of_pages, pdfpages_actual_no_of_pages.ToString(), "equals");

                    string pdfcontent_elementname  = finwellbeingpdfcontent.ElementAt(i)[2];
                    string pdfcontent_expectedtext = finwellbeingpdfcontent.ElementAt(i)[4];

                    string pdfcontent_actualtext = utilityKeywords.GetPDFContentFromURL(actual_page_url);
                    Console.WriteLine("PDF content : " + pdfcontent_actualtext);
                    softAssertions.Add("Element : " + pdfcontent_elementname, pdfcontent_expectedtext, pdfcontent_actualtext.ToString(), "contains");
                }
                else
                {
                    softAssertions.Add("Element : Pdf URl ", pdfpages_urlvalue, actual_page_url.ToString(), "contains");
                }
                Console.WriteLine("Close Current Tab");
                SeleniumKeywords.CloseCurrentTab();
                SeleniumKeywords.SwitchToTab(1);
                Console.WriteLine("Switch to first tab");
            }

            if (clientname.ToLower().Equals("health trust"))
            {
                VerifyMoreResourcesTile(finwellbeingviewbtn.ElementAt(len - 1)[3], finwellbeingviewbtn.ElementAt(len - 1)[5], "moreresourcesusername");
            }
            else if (clientname.ToLower().Equals("meabt"))
            {
                VerifyMoreResourcesTile(finwellbeingviewbtn.ElementAt(len - 1)[3], finwellbeingviewbtn.ElementAt(len - 1)[5], "moreresources");
            }
        }