示例#1
0
        public void TC_MessageToCoach()
        {
            SeleniumKeywords.RefreshPage();
            System.Threading.Thread.Sleep(3000);

            coachingEnabled  = cmn.GetConfig("CoachingEnabled").ElementAt(0)[1].ToLower();
            incentiveEnabled = cmn.GetConfig("IncentiveEnabled").ElementAt(0)[1].ToLower();
            if (coachingEnabled.Equals("false"))
            {
                Assert.Ignore("Coaching not enabled for clients");
            }
            if (incentiveEnabled.Equals("true"))
            {
                points = cmn.GetPoints(clientname);
            }
            //Click on Message to coach icon on Dashboard
            Common pcommon = new Common();

            pcommon.GoToMessageToCoachPage();
            //Call Verify Message Page UI Elements
            Page_MessageToCoach pmsgcoach = new Page_MessageToCoach(softassertions);

            pmsgcoach.VerifyMessagetoCoachPage();
            is_soft_assert = true;
            softassertions.AssertAll();
            MessageToCoach mtc = new MessageToCoach();

            mtc.TC_VerifySentMsgToCoach();
            if (incentiveEnabled.Equals("true"))
            {
                mtc.TC_ValidatePoints();
            }
            mtc.TC_ValidateMessageToCoachIncentiveHistory();
            mtc.TC_VerifyMessageFilters();
        }
        public void TC_VerifyMessageToCoachUI()
        {
            List <string[]> isEnabled = cmn.GetConfig("CoachingEnabled", "IncentiveEnabled");

            incentiveEnabled = isEnabled.ElementAt(0)[2].ToLower();
            coachingEnabled  = isEnabled.ElementAt(0)[1].ToLower();
            clientname       = GlobalVariables.clientname;
            if (coachingEnabled.Equals("false") && !GlobalVariables.clientname.ToLower().Equals("arc"))
            {
                Assert.Ignore("Message to coach not available for client");
            }

            Page_Login plogin = new Page_Login();

            plogin.Login();
            Page_HAPrompt haprompt = new Page_HAPrompt();

            haprompt.GoToDashboard();
            if (incentiveEnabled.Equals("true"))
            {
                points = cmn.GetPoints(clientname);
            }
            //Click on Message to coach icon on Dashboard
            Common pcommon = new Common();

            pcommon.GoToMessageToCoachPage();
            //Call Verify Message Page UI Elements
            Page_MessageToCoach pmsgcoach = new Page_MessageToCoach(softassertions);

            pmsgcoach.VerifyMessagetoCoachPage();
            is_soft_assert = true;
            softassertions.AssertAll();
            //Common logout = new Common();
            //logout.LogOut();
        }
        public void TC_VerifyMessageFilters()
        {
            if (coachingEnabled.Equals("false") && !GlobalVariables.clientname.ToLower().Equals("arc"))
            {
                Assert.Ignore("Message to coach not available for client");
            }
            List <string[]>     result    = new List <string[]>();
            Page_MessageToCoach pmsgcoach = new Page_MessageToCoach();

            //This softAssert is use to verify Archive message, Delete message and all the filter Sent, Deleted, Archived, Inbound and All
            result = pmsgcoach.VerfySendMsgDropDown();
            string actualmsg;

            is_soft_assert = false;
            Assert.Multiple(() =>
            {
                for (int i = 0; i < result.Count; i++)
                {
                    actualmsg = result.ElementAt(i)[0];
                    if (actualmsg == "You have no inbound messages.")
                    {
                        Assert.AreEqual("You have no inbound messages.", actualmsg);
                    }
                    else
                    {
                        Assert.AreEqual(actualmsg, expmsg);
                    }
                }
            }
                            );
        }
        public void TC_VerifySentMsgToCoach()
        {
            List <string[]> isEnabled = cmn.GetConfig("CoachingEnabled", "IncentiveEnabled");

            incentiveEnabled = isEnabled.ElementAt(0)[2].ToLower();
            coachingEnabled  = isEnabled.ElementAt(0)[1].ToLower();
            if (coachingEnabled.Equals("false") && !GlobalVariables.clientname.ToLower().Equals("arc"))
            {
                Assert.Ignore("Message to coach not available for client");
            }
            //Page_Login plogin = new Page_Login();
            //plogin.Login();
            //Common pcommon = new Pages.Common();
            //pcommon.GoToMessageToCoachPage();
            expmsg = "Hi Coach this is me";
            //this call send and verify the send message to coach
            Page_MessageToCoach pmsgcoach = new Page_MessageToCoach();
            String actmesg = pmsgcoach.VerifyMsgToCoach(expmsg);

            SeleniumKeywords.RefreshPage();

            //Console.WriteLine(expmsg.ElementAt(0)[0]);
            Assert.AreEqual(expmsg, actmesg);
        }