public void MarkAsRead_Knowledbase_Item_OrgGroupForUserWithSO31_WithoutRestriction()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Mark As Read Knowledgebase Item assigned to Org Group where user has SO 31 access and without restricted viewing");

                String strTestCaseNo = "TC005";
                String strtblname    = "automation_summary_knowledgebase";
                String strTestType   = "Progression";


                /* Get test data from MySQL */

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataSummary_Knowledgebase = connection.Select(strtblname, strTestCaseNo, strTestType);


                string strTDTitle     = testdataSummary_Knowledgebase[3];
                string strTDOtherUser = testdataSummary_Knowledgebase[16];
                string strTDLogin     = testdataSummary_Knowledgebase[20];

                ConnectToMySQL_Fetch_TestData MySQLConnect = new ConnectToMySQL_Fetch_TestData();

                String[] TestData = new string[3];
                TestData = MySQLConnect.GetLoginDetails(strTDLogin);

                string strTDUsername = TestData[1];
                string strTDPassword = TestData[2];

                Console.WriteLine(strTDUsername);
                Console.WriteLine(strTDPassword);

                FpLoginPage loginPage = new FpLoginPage();

                loginPage.LoginWithUserCredentials(strTDUsername, strTDPassword);

                FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage();

                Knowledgebase.MarkAsRead_Knowledgebase_Item(strTDTitle);

                FpSummaryPage Summary = new FpSummaryPage();

                String[] Knowledgebasedetails = Summary.RetrieveKnowledgebaseGriddetails(strTDTitle);
                String   strFPwebItem         = Knowledgebasedetails[0];

                System.Threading.Thread.Sleep(15000);


                /* Validate Item for logged in user */
                try
                {
                    Assert.IsNull(strFPwebItem);
                    PropertiesCollection.test.Log(Status.Pass, "Data on grid validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Data on grid validated for logged in user and failed");
                }

                System.Threading.Thread.Sleep(15000);

                /* Validate Item for other user */

                Summary.BtnPeopleSelector.Click();
                System.Threading.Thread.Sleep(5000);
                Summary.TxtPeopleSearch.SendKeys(strTDOtherUser);
                System.Threading.Thread.Sleep(5000);
                Summary.BtnSearch.Click();
                System.Threading.Thread.Sleep(5000);
                Summary.PersonSelection.Click();
                System.Threading.Thread.Sleep(15000);
                Summary.BtnApply.Click();
                System.Threading.Thread.Sleep(5000);

                try
                {
                    Assert.IsNull(strFPwebItem);
                    PropertiesCollection.test.Log(Status.Pass, "Data on grid validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Data on grid validated for other user and failed");
                }
            }
Пример #2
0
            public void MarkAsRead_Knowledbase_Item_OrgGroupForUserWithoutSO31_WithRestriction()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Mark As Read Knowledgebase Item assigned to Org Group where user does not have SO 31 access and with restricted viewing");

                String strTestCaseNo = "TC008";
                String strtblname    = "automation_summary_knowledgebase";
                String strTestType   = "Progression";


                /* Get test data from MySQL */

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataSummary_Knowledgebase = connection.Select(strtblname, strTestCaseNo, strTestType);


                string strTDTitle     = testdataSummary_Knowledgebase[3];
                string strTDOtherUser = testdataSummary_Knowledgebase[16];
                string strTDLogin     = testdataSummary_Knowledgebase[20];

                ConnectToMySQL_Fetch_TestData MySQLConnect = new ConnectToMySQL_Fetch_TestData();

                String[] TestData = new string[3];
                TestData = MySQLConnect.GetLoginDetails(strTDLogin);

                string strTDUsername = TestData[1];
                string strTDPassword = TestData[2];

                Console.WriteLine(strTDUsername);
                Console.WriteLine(strTDPassword);

                FpLoginPage loginPage = new FpLoginPage();

                loginPage.LoginWithUserCredentials(strTDUsername, strTDPassword);

                FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage();

                Knowledgebase.MarkAsRead_Knowledgebase_Item(strTDTitle);

                System.Threading.Thread.Sleep(15000);
                FpSideMenus SideMenu = new FpSideMenus();

                SideMenu.SummaryClick();
                System.Threading.Thread.Sleep(15000);

                FpSummaryPage Summary = new FpSummaryPage();

                String[] Knowledgebasedetails = Summary.RetrieveKnowledgebaseGriddetails(strTDTitle);
                String   strFPwebItem         = Knowledgebasedetails[0];
                String   strFPwebNowDated     = Knowledgebasedetails[1];
                String   strFPwebYourDate     = Knowledgebasedetails[2];
                String   strFPwebNowVersioned = Knowledgebasedetails[3];
                String   strFPwebYourVersion  = Knowledgebasedetails[4];
                String   strFPwebDaysOld      = Knowledgebasedetails[5];
                String   strFPwebStatus       = Knowledgebasedetails[6];

                /* Validate for logged in user */

                /* Validate Item  */
                try
                {
                    Assert.IsNull(strFPwebItem);
                    PropertiesCollection.test.Log(Status.Pass, "Data on grid validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Data on grid validated for logged in user and failed");
                }

                System.Threading.Thread.Sleep(15000);

                int Never = Summary.RetrieveKnowledgebaseNeverCount();
                int Old   = Summary.RetrieveKnowledgebaseOldCount();

                try
                {
                    Assert.AreEqual(Never, Convert.ToInt32(Summary.CountNever.Text.Substring(0, 1)));
                    PropertiesCollection.test.Log(Status.Pass, "Count of Never items validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Never items validated for logged in user and failed");
                }

                try
                {
                    Assert.AreEqual(Old, Convert.ToInt32(Summary.CountOld.Text.Substring(0, 1)));
                    PropertiesCollection.test.Log(Status.Pass, "Count of Old items validated and for logged in user passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Old items validated and for logged in user failed");
                }

                /* Validate for other user */

                Summary.BtnPeopleSelector.Click();
                System.Threading.Thread.Sleep(5000);
                Summary.TxtPeopleSearch.SendKeys(strTDOtherUser);
                System.Threading.Thread.Sleep(5000);
                Summary.BtnSearch.Click();
                System.Threading.Thread.Sleep(5000);
                Summary.PersonSelection.Click();
                System.Threading.Thread.Sleep(15000);
                Summary.BtnApply.Click();
                System.Threading.Thread.Sleep(5000);

                /* Validate Item  */
                try
                {
                    Assert.IsNull(strFPwebItem);
                    PropertiesCollection.test.Log(Status.Pass, "Data on grid for other user validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Data on grid for other user validated and failed");
                }

                Never = Summary.RetrieveKnowledgebaseNeverCount();
                Old   = Summary.RetrieveKnowledgebaseOldCount();

                try
                {
                    Assert.AreEqual(Never, Convert.ToInt32(Summary.CountNever.Text.Substring(0, 1)));
                    PropertiesCollection.test.Log(Status.Pass, "Count of Never items for other user validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Never items for other user validated and failed");
                }

                try
                {
                    Assert.AreEqual(Old, Convert.ToInt32(Summary.CountOld.Text.Substring(0, 1)));
                    PropertiesCollection.test.Log(Status.Pass, "Count of Old items for other user validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Old items for other user validated and failed");
                }
            }