コード例 #1
0
            public void US_41948_Workflows_ViewHeader()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("US_41948_Workflows_ViewHeader");
                FpSideMenus sidebarMenu = new FpSideMenus();

                sidebarMenu.LnkSummary.Click();
                FpSummaryPage summary = new FpSummaryPage();

                System.Threading.Thread.Sleep(4000);
                Console.WriteLine("Count" + summary.RetriveWorkflowCount());
                var noofWorkflows = summary.RetriveWorkflowCount();

                Console.WriteLine();

                for (int i = 0; i < summary.grdWorkflow.Count; i++)
                {
                    System.Threading.Thread.Sleep(2000);
                    summary.grdWorkflow.ElementAt(i).Click();
                    System.Threading.Thread.Sleep(2000);

                    System.Threading.Thread.Sleep(2000);
                    // Assert.AreEqual(summary.grdWorkflowTypes.ElementAt(i).Text,summary.txtboxWorkFlowType.GetAttribute("value"));

                    Console.WriteLine("WorkFlowLinkedTo:", summary.grdLinkedTo.ElementAt(i).Text);
                    // Assert.AreEqual(summary.grdLinkedTo.ElementAt(i).Text,summary.txtboxWorkFlowLinkedTo.GetAttribute("value"));

                    Console.WriteLine("WorkFlowTitleDescription:", summary.grdTitleDescription.ElementAt(i).Text);
                    // Assert.AreEqual(summary.grdTitleDescription.ElementAt(i).Text,summary.txtboxWorkFlowTitle.GetAttribute("value"));

                    Console.WriteLine("WorkFlowNotes:", summary.grdNotes.ElementAt(i).Text);
                    // Assert.AreEqual(summary.grdTitleDescription.ElementAt(i).Text,summary.txtboxWorkFlowNotes.GetAttribute("value"));

                    Console.WriteLine("WorkFlowDueDate:", summary.grdDue.ElementAt(i).Text);
                }
            }
            public void Launch_Knowledbase_Item_UserWithoutSO31_WithoutRestriction()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Launch Knowledgebase Item assigned to user without SO 31 access and without restricted viewing");

                String strTestCaseNo = "TC003";
                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 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];


                FpLoginPage loginPage = new FpLoginPage();

                loginPage.LoginWithUserCredentials(strTDUsername, strTDPassword);
                System.Threading.Thread.Sleep(15000);

                /* Launch Knowledge base item from Knowledge base Grid */
                FpSummaryPage Summary     = new FpSummaryPage();
                string        KBGridTitle = Summary.KnowledgebaseGridFirstItem.Text;

                Actions action = new Actions(PropertiesCollection.driver);

                action.MoveToElement(Summary.KnowledgebaseGridFirstItem).DoubleClick().Perform();
                System.Threading.Thread.Sleep(15000);

                FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage();

                System.Threading.Thread.Sleep(15000);
                try
                {
                    Assert.AreEqual(KBGridTitle, Knowledgebase.txtKBItemTitle.Text);
                    PropertiesCollection.test.Log(Status.Pass, "Launch Knowledgebase Item validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Launch Knowledgebase Item validated and failed");
                }
            }
        public void US_38078_View_Workflow_Settings()
        {
            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("US_38078_View_Workflow_Settings");
            FpSideMenus SideMenu = new FpSideMenus();

            System.Threading.Thread.Sleep(10000);
            SideMenu.LnkSummary.Click();
            FpSummaryPage Summary = new FpSummaryPage();

            var countlblWorkflowicon  = Summary.countlblWorkflowicon;
            var countlblworkflowTitle = Summary.countlblWorkflowicon;

            if (countlblWorkflowicon == 0 || countlblworkflowTitle == 0)
            {
                Summary.btnSettings.Click();
                SelectElement dropdown1 = new SelectElement(PropertiesCollection.driver.FindElement(By.Id("optionDisplaySettings")));
                dropdown1.SelectByValue("4");
                PropertiesCollection.driver.FindElement(By.XPath("//*[@id=\"saveDisplaySettings\"]")).Click();
                Assert.IsTrue(Summary.lblWorkflowTitle.Displayed);
                Assert.IsTrue(Summary.lblWorkflowicon.Displayed);
            }

            Summary.btnSettings.Click();
            System.Threading.Thread.Sleep(2000);

            for (int i = 0; i < Summary.countDisplaySetting.Count; i++)
            {
                if (Summary.DisplaySetting.ElementAt(i).Text.Equals("Workflows"))
                {
                    Summary.countDisplaySetting.ElementAt(i).Click();
                    break;
                }
            }
            System.Threading.Thread.Sleep(5000);
            var btnSave = PropertiesCollection.driver.FindElement(By.XPath("//*[@id=\"saveDisplaySettings\"]"));

            System.Threading.Thread.Sleep(2000);
            btnSave.Click();
            System.Threading.Thread.Sleep(2000);
            Assert.AreEqual(Summary.countlblWorkflowTitle, 0);
            Assert.AreEqual(Summary.countlblWorkflowicon, 0);
        }
        public void US_42249_View_WorkflowList_LinkedToColumn()
        {
            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("US_42249_View_WorkflowList_LinkedToColumn");
            FpSideMenus SideMenu = new FpSideMenus();

            System.Threading.Thread.Sleep(10000);
            SideMenu.LnkSummary.Click();
            FpSummaryPage Summary = new FpSummaryPage();

            Assert.IsTrue(Summary.lblWorkflowTitle.Displayed);
            Assert.IsTrue(Summary.lblWorkflowicon.Displayed);
            Summary.btnSettings.Click();
            System.Threading.Thread.Sleep(2000);
            IWebElement element = PropertiesCollection.driver.FindElement(By.XPath("//*[@id=\"extraOptions\"]/div/div[2]/div/div[2]/div"));

            new Actions(PropertiesCollection.driver).MoveToElement(element).MoveByOffset(10, 10).Click().Perform();
            SelectElement dropdown = new SelectElement(PropertiesCollection.driver.FindElement(By.Id("optionDisplaySettings")));

            dropdown.SelectByValue("0");
            PropertiesCollection.driver.FindElement(By.Id("saveDisplaySettings")).Click();

            Summary.btnSettings.Click();
            System.Threading.Thread.Sleep(2000);

            for (int i = 0; i < Summary.countDisplaySetting.Count; i++)
            {
                if (Summary.DisplaySetting.ElementAt(i).Text.Equals("Workflows"))
                {
                    Summary.countDisplaySetting.ElementAt(i).Click();
                    break;
                }
            }
            System.Threading.Thread.Sleep(5000);
            var btnSave = PropertiesCollection.driver.FindElement(By.XPath("//*[@id=\"saveDisplaySettings\"]"));

            System.Threading.Thread.Sleep(2000);
            btnSave.Click();
            System.Threading.Thread.Sleep(2000);
            Assert.AreEqual(Summary.countlblWorkflowTitle, 0);
            Assert.AreEqual(Summary.countlblWorkflowicon, 0);
        }
            public void Verify_Knowledbase_Grid_OrgGroupForUserWithSO31_WithoutRestriction()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Validate 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 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];

                FpLoginPage loginPage = new FpLoginPage();

                loginPage.LoginWithUserCredentials(strTDUsername, strTDPassword);

                FpSummaryPage Summary = new FpSummaryPage();

                System.Threading.Thread.Sleep(30000);
                try
                {
                    Assert.IsTrue(Summary.LblNoData.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Knowledgebase Item Grid validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Knowledgebase Item Grid validated and failed");
                }

                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 and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Never items validated 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 passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Old items validated and failed");
                }
            }
            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");
                }
            }
            public void Add_Knowledbase_Item_OrgGroupForUserWithSO31_WithoutRestriction()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Add 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 strTDContent         = testdataSummary_Knowledgebase[4];
                string strTDVersion         = testdataSummary_Knowledgebase[5];
                string strTDDate            = testdataSummary_Knowledgebase[6];
                string strTDRestrictViewing = testdataSummary_Knowledgebase[7];
                string strTDYourDate        = testdataSummary_Knowledgebase[8];
                string strTDYourVersion     = testdataSummary_Knowledgebase[9];
                string strTDStatus          = testdataSummary_Knowledgebase[10];
                string strTDUser            = testdataSummary_Knowledgebase[11];
                string strTDOtherUser       = testdataSummary_Knowledgebase[16];
                string strTDLogin           = testdataSummary_Knowledgebase[20];

                /* Calculate Days Old */

                string strTDDaysOld = GetDaysOldUnreadKnowledgeBaseItem(Convert.ToDateTime(strTDDate)).ToString();

                Console.WriteLine(strTDDaysOld);

                /* Identify OrgGroupId for the OrgGroup */

                string strSQLtblname      = "tblPeopleGroup";
                string strtblselectcolumn = "PeopleGroupID";
                string strtblcolumn       = "PeopleGroupName";
                string strwherecondn      = strTDUser;
                var    conn       = new ConnectToSQLServer();
                string OrgGroupID = conn.Select(strSQLtblname, strtblselectcolumn, strtblcolumn, strwherecondn);


                /* Identify OrgGroupId for second OrgGroup */


                strwherecondn = strTDOtherUser;
                conn          = new ConnectToSQLServer();
                string OrgGroupIDOther = conn.Select(strSQLtblname, strtblselectcolumn, strtblcolumn, strwherecondn);

                /* Add Knowledgebase item and assign to user with SO 31 access and without restricted viewing */

                FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage();

                System.Threading.Thread.Sleep(15000);
                Knowledgebase.Add_Knowledgebase_Item_AssigntoOrgGroup(strTDTitle, strTDContent, strTDVersion, strTDDate, strTDRestrictViewing, OrgGroupID, OrgGroupIDOther);
                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];


                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];

                FpLoginPage loginPage = new FpLoginPage();

                loginPage.LoginWithUserCredentials(strTDUsername, strTDPassword);

                System.Threading.Thread.Sleep(15000);

                /* Validate for logged in user */

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

                /* Validate Now Dated column */
                try
                {
                    Assert.AreEqual(strTDDate, strFPwebNowDated);
                    PropertiesCollection.test.Log(Status.Pass, "Now Dated column on grid validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Now Dated column on grid validated for logged in user and failed");
                }

                /* Validate Your Date column */
                try
                {
                    Assert.AreEqual(strTDYourDate, strFPwebYourDate);
                    PropertiesCollection.test.Log(Status.Pass, "Your Date column on grid validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Your Date column on grid validated for logged in user and failed");
                }

                /* Validate Now Versioned column */
                try
                {
                    Assert.AreEqual(strTDVersion, strFPwebNowVersioned);
                    PropertiesCollection.test.Log(Status.Pass, "Now Versioned column on grid validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Now Versioned column on grid validated for logged in user and failed");
                }

                /* Validate Your Version column */
                try
                {
                    Assert.AreEqual(strTDYourVersion, strFPwebYourVersion);
                    PropertiesCollection.test.Log(Status.Pass, "Your Version column on grid validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Your Version column on grid validated for logged in user and failed");
                }

                /* Validate Days Old column */

                try
                {
                    Assert.AreEqual(strTDDaysOld, strFPwebDaysOld);
                    PropertiesCollection.test.Log(Status.Pass, "Days Old column on grid validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Days Old column on grid validated for logged in user and failed");
                }

                /* Validate Status column */
                try
                {
                    Assert.AreEqual(strTDStatus, strFPwebStatus);
                    PropertiesCollection.test.Log(Status.Pass, "Status column on grid validated for logged in user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Status column on grid validated for logged in user and failed");
                }

                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 and failed");
                }

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

                System.Threading.Thread.Sleep(5000);

                /* Validation 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 column */
                try
                {
                    Assert.AreEqual(strTDTitle, strFPwebItem);
                    PropertiesCollection.test.Log(Status.Pass, "Item column on grid validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Item column on grid validated for other user and failed");
                }

                /* Validate Now Dated column */
                try
                {
                    Assert.AreEqual(strTDDate, strFPwebNowDated);
                    PropertiesCollection.test.Log(Status.Pass, "Now Dated column on grid validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Now Dated column on grid validated for other user and failed");
                }

                /* Validate Your Date column */
                try
                {
                    Assert.AreEqual(strTDYourDate, strFPwebYourDate);
                    PropertiesCollection.test.Log(Status.Pass, "Your Date column on grid validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Your Date column on grid validated for other user and failed");
                }

                /* Validate Now Versioned column */
                try
                {
                    Assert.AreEqual(strTDVersion, strFPwebNowVersioned);
                    PropertiesCollection.test.Log(Status.Pass, "Now Versioned column on grid validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Now Versioned column on grid validated for other user and failed");
                }

                /* Validate Your Version column */
                try
                {
                    Assert.AreEqual(strTDYourVersion, strFPwebYourVersion);
                    PropertiesCollection.test.Log(Status.Pass, "Your Version column on grid validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Your Version column on grid validated for other user and failed");
                }

                /* Validate Days Old column */

                try
                {
                    Assert.AreEqual(strTDDaysOld, strFPwebDaysOld);
                    PropertiesCollection.test.Log(Status.Pass, "Days Old column on grid validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Days Old column on grid validated for other user and failed");
                }

                /* Validate Status column */
                try
                {
                    Assert.AreEqual(strTDStatus, strFPwebStatus);
                    PropertiesCollection.test.Log(Status.Pass, "Status column on grid validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Status column on grid validated for other user 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 validated for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Never items validated for other 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 for other user and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Old items validated for other user and failed");
                }
            }
コード例 #8
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");
                }
            }
コード例 #9
0
            public void TS01_TC01_ValidateSideMenus()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS01_TC01_ValidateSideMenus");

                /* Validate Summary Page*/

                FpSideMenus SideMenu = new FpSideMenus();

                SideMenu.SummaryClick();
                System.Threading.Thread.Sleep(30000);
                FpSummaryPage Summary = new FpSummaryPage();

                try
                {
                    Assert.AreEqual(Summary.UserName.Text, "testuser2, AT");
                    PropertiesCollection.test.Log(Status.Pass, "Summary Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Summary Page not loaded");
                    throw;
                }

                /* Validate Calendar Page*/

                Actions actions = new Actions(PropertiesCollection.driver);

                actions.MoveToElement(SideMenu.LnkCalendar).Perform();
                System.Threading.Thread.Sleep(30000);

                SideMenu.CalendarClick();
                System.Threading.Thread.Sleep(30000);

                try
                {
                    //Assert.AreEqual(FpCalendarPage.GetLoggedInUserName(), "testuser2, AT");
                    PropertiesCollection.test.Log(Status.Pass, "Calendar Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Calendar Page not loaded");
                    throw;
                }

                /* Validate Control Hours Report Page*/

                SideMenu.ControlHoursReportClick();
                System.Threading.Thread.Sleep(30000);
                FpControlHoursReportPage ControlHoursReport = new FpControlHoursReportPage();

                try
                {
                    Assert.AreEqual(ControlHoursReport.GetReportName(), "Control Hours Report");
                    PropertiesCollection.test.Log(Status.Pass, "Control Hours Report Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Control Hours Report Page not loaded");
                    throw;
                }

                /* Validate Currency History Report Page*/

                SideMenu.CurrencyHistoryReportClick();
                System.Threading.Thread.Sleep(30000);
                FpCurrencyHistoryReportPage CurrencyHistoryReport = new FpCurrencyHistoryReportPage();

                try
                {
                    Assert.AreEqual(CurrencyHistoryReport.GetReportName(), "Currency History Report");
                    PropertiesCollection.test.Log(Status.Pass, "Currency History Report Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Currency History Report Page not loaded");
                    throw;
                }

                /* Validate Events Report Page*/

                SideMenu.EventsReportClick();
                System.Threading.Thread.Sleep(30000);
                FpEventsReportPage EventsReport = new FpEventsReportPage();

                try
                {
                    Assert.AreEqual(EventsReport.GetReportName(), "Events Report");
                    PropertiesCollection.test.Log(Status.Pass, "Events Report Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Events Report Page not loaded");
                    throw;
                }

                /*Validate Roster Page */

                SideMenu.RosterClick();
                System.Threading.Thread.Sleep(30000);
                FpRosterPage Roster = new FpRosterPage();

                try
                {
                    Assert.IsTrue(Roster.RosterTable.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Roster Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Roster Page not loaded");
                    throw;
                }

                /* Validate Daily Scheduling Page*/

                SideMenu.DailySchedulingClick();
                System.Threading.Thread.Sleep(30000);
                FpDailySchedulingPage DailyScheduling = new FpDailySchedulingPage();

                try
                {
                    Assert.IsTrue(DailyScheduling.Table.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Daily Scheduling Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Daily Scheduling Page not loaded");
                    throw;
                }

                /* Validate Duty Times Page*/

                SideMenu.DutyTimesClick();
                System.Threading.Thread.Sleep(30000);
                FpControlHoursPage DutyTimes = new FpControlHoursPage();

                try
                {
                    Assert.AreEqual((DutyTimes.Title()), "testuser2, AT");
                    PropertiesCollection.test.Log(Status.Pass, "Duty Times Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Duty Times Page not loaded");
                    throw;
                }

                /* Validate Control Hours Page*/

                SideMenu.ControlHoursClick();
                System.Threading.Thread.Sleep(30000);
                FPControlHoursPage ControlHours = new FPControlHoursPage();

                try
                {
                    Assert.AreEqual((ControlHours.Title()), "Control Hours");
                    PropertiesCollection.test.Log(Status.Pass, "Control Hours Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Control Hours Page not loaded");
                    throw;
                }

                /* Validate Programme Viewer Page */

                SideMenu.ProgrammeViewerClick();
                System.Threading.Thread.Sleep(30000);
                FpProgrammeViewerPage ProgrammeViewer = new FpProgrammeViewerPage();

                try
                {
                    Assert.IsTrue(ProgrammeViewer.Grid.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Programme Viewer Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Programme Viewer Page not loaded");
                    throw;
                }

                /* Validate Knowledge Base Page */

                SideMenu.KnowledgeBaseClick();
                System.Threading.Thread.Sleep(30000);
                FpKnowledgeBasePage KnowledgeBase = new FpKnowledgeBasePage();

                try
                {
                    Assert.IsTrue(KnowledgeBase.RowValue.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Knowledge Base Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Knowledge Base Page not loaded");
                    throw;
                }

                /* validate status board page*/

                SideMenu.LnkStatusBoard.Click();
                System.Threading.Thread.Sleep(5000);
                FpStatusBoardPage StatusBoard = new FpStatusBoardPage();

                try
                {
                    Assert.IsTrue(StatusBoard.StatusBoard.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Status Board Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Status Board Page not loaded");
                    throw;
                }

                /* Validate Combined Schedule Page */

                SideMenu.CombinedScheduleClick();
                System.Threading.Thread.Sleep(30000);
                FpCombinedSchedulePage CombinedSchedule = new FpCombinedSchedulePage();

                PropertiesCollection.driver.SwitchTo().Frame(CombinedSchedule.frame);

                try
                {
                    Assert.IsTrue(CombinedSchedule.title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Combined Schedule Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Combined Schedule Page not loaded");
                    throw;
                }
            }
            public void Update_Knowledbase_Item_UserWithoutSO31_WithoutRestriction()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Update Knowledgebase Item assigned to user without SO 31 access and without restricted viewing");

                String strTestCaseNo = "TC003";
                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 strTDVersion         = testdataSummary_Knowledgebase[5];
                string strTDDate            = testdataSummary_Knowledgebase[6];
                string strTDRestrictViewing = testdataSummary_Knowledgebase[7];
                string strTDYourDate        = testdataSummary_Knowledgebase[8];
                string strTDYourVersion     = testdataSummary_Knowledgebase[9];
                string strTDStatus          = testdataSummary_Knowledgebase[10];
                string strTDUser            = testdataSummary_Knowledgebase[11];
                string strTDUpdatedVersion  = testdataSummary_Knowledgebase[12];
                string strTDUpdatedContent  = testdataSummary_Knowledgebase[13];
                string strTDOtherUser       = testdataSummary_Knowledgebase[16];
                string strTDOtherLogin      = testdataSummary_Knowledgebase[17];
                string strTDUpdatedStatus   = testdataSummary_Knowledgebase[18];
                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];

                FpLoginPage loginPage = new FpLoginPage();

                loginPage.LoginWithUserCredentials(strTDUsername, strTDPassword);

                /* Calculate Days Old */

                string strTDDaysOld = GetDaysOldUnreadKnowledgeBaseItem(Convert.ToDateTime(strTDDate)).ToString();

                Console.WriteLine(strTDDaysOld);

                FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage();

                Knowledgebase.Update_Knowledgebase_Item(strTDTitle, strTDUpdatedVersion, strTDUpdatedContent);
                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];


                System.Threading.Thread.Sleep(15000);

                /* Validate for logged in user */

                /* Validate Item column */
                try
                {
                    Assert.AreEqual(strTDTitle, strFPwebItem);
                    PropertiesCollection.test.Log(Status.Pass, "Item column on grid validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Item column on grid validated and failed");
                }

                /* Validate Now Dated column */
                try
                {
                    Assert.AreEqual(strTDDate, strFPwebNowDated);
                    PropertiesCollection.test.Log(Status.Pass, "Now Dated column on grid validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Now Dated column on grid validated and failed");
                }

                /* Validate Your Date column */
                try
                {
                    Assert.AreEqual(DateTime.Now.ToString("dd MMM yyyy"), strFPwebYourDate);
                    PropertiesCollection.test.Log(Status.Pass, "Your Date column on grid validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Your Date column on grid validated and failed");
                }

                /* Validate Now Versioned column */
                try
                {
                    Assert.AreEqual(strTDUpdatedVersion, strFPwebNowVersioned);
                    PropertiesCollection.test.Log(Status.Pass, "Now Versioned column on grid validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Now Versioned column on grid validated and failed");
                }

                /* Validate Your Version column */
                try
                {
                    Assert.AreEqual(strTDVersion, strFPwebYourVersion);
                    PropertiesCollection.test.Log(Status.Pass, "Your Version column on grid validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Your Version column on grid validated and failed");
                }

                /* Validate Days Old column */

                try
                {
                    Assert.AreEqual(strTDDaysOld, strFPwebDaysOld);
                    PropertiesCollection.test.Log(Status.Pass, "Days Old column on grid validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Days Old column on grid validated and failed");
                }

                /* Validate Status column */
                try
                {
                    Assert.AreEqual(strTDUpdatedStatus, strFPwebStatus);
                    PropertiesCollection.test.Log(Status.Pass, "Status column on grid validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Status column on grid validated and failed");
                }

                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 and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Never items validated 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 passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Count of Old items validated and 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);

                try
                {
                    Assert.IsTrue(Summary.LblNoData.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Update Knowledgebase Item  for other user validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Update Knowledgebase Item 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");
                }
            }