public void US_42183_PreventCrossSiteScripts_KnowledgeBase() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("US_42183_PreventCrossSiteScripts_KnowledgeBase"); FpSideMenus SideMenu = new FpSideMenus(); System.Threading.Thread.Sleep(5000); SideMenu.LnkKnowledgeBase.Click(); System.Threading.Thread.Sleep(8000); FpKnowledgeBasePage KnowledgeBasePage = new FpKnowledgeBasePage(); foreach (var script in crossSiteScripts) { KnowledgeBasePage.btnAddKnowledgebaseByEntry.Click(); KnowledgeBasePage.txtboxKnowledgeBaseTitle.SendKeys(script); PropertiesCollection.driver.SwitchTo().Frame(KnowledgeBasePage.iFrame); KnowledgeBasePage.txtAreaFrameKnowledgeBase.SendKeys(script); System.Threading.Thread.Sleep(2000); PropertiesCollection.driver.SwitchTo().DefaultContent(); KnowledgeBasePage.btnSave.Click(); Assert.IsTrue(KnowledgeBasePage.btnSave.Displayed); KnowledgeBasePage.txtboxKnowledgeBaseTitle.Clear(); KnowledgeBasePage.txtboxKnowledgeBaseTitle.SendKeys("Modified Title"); KnowledgeBasePage.btnSave.Click(); System.Threading.Thread.Sleep(2000); Assert.AreEqual(KnowledgeBasePage.countbtnSave, 0); System.Threading.Thread.Sleep(2000); Assert.AreEqual(KnowledgeBasePage.lbliFrameKnowledgeBase.Text, script); KnowledgeBasePage.btnDelete.Click(); KnowledgeBasePage.btnOK.Click(); System.Threading.Thread.Sleep(2000); } }
public void Delete_Knowledbase_Item_OrgGroupForUserWithoutSO31_WithRestriction() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Delete 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 strTDRestrictViewing = testdataSummary_Knowledgebase[7]; string strTDUser = testdataSummary_Knowledgebase[11]; string strTDLogin = testdataSummary_Knowledgebase[20]; /* 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); 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); FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage(); Knowledgebase.Delete_Knowledgebase_Item_AssignedtoOrgGroup(strTDTitle, strTDRestrictViewing, OrgGroupID); try { Assert.IsTrue(Knowledgebase.txtKBItem.Displayed); PropertiesCollection.test.Log(Status.Fail, "Knowledgebase Item could not be deleted"); } catch { PropertiesCollection.test.Log(Status.Pass, "Knowledgebase Item deleted"); } }
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_41889_PreventMaliciousFileUpload_KnowledgeBase_InvalidFiles() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("US_41889_PreventMaliciousFileUpload_KnowledgeBase_InvalidFiles"); var connection = new ConnectToMySQL_Fetch_TestData(); var sidebarMenu = new FpSideMenus(); var knowledgeBase = new FpKnowledgeBasePage(); var folderLocation = "Malicious Files\\"; sidebarMenu.KnowledgeBaseClick(); System.Threading.Thread.Sleep(4000); foreach (var file in fileList_ValidVideoFiles) { System.Threading.Thread.Sleep(4000); knowledgeBase.btnAddKnowledgebaseByEntry.Click(); System.Threading.Thread.Sleep(2000); knowledgeBase.btnBrowse.Click(); System.Threading.Thread.Sleep(4000); AutoIt.AutoItX.ControlFocus("Open", "", "Edit1"); AutoIt.AutoItX.ControlSetText("Open", "", "Edit1", System.Configuration.ConfigurationManager.AppSettings["MaliciousFileUploadLocation"] + folderLocation + file); AutoIt.AutoItX.ControlClick("Open", "", "Button1"); System.Threading.Thread.Sleep(2000); knowledgeBase.btnSave.Click(); System.Threading.Thread.Sleep(2000); string filename = knowledgeBase.grdFileNameRow.Text; try { Assert.AreEqual(file, filename); PropertiesCollection.test.Log(Status.Pass, "File: " + filename + " is successfully uploaded from Location: " + System.Configuration.ConfigurationManager.AppSettings["MaliciousFileUploadLocation"] + folderLocation); } catch { PropertiesCollection.test.Log(Status.Fail, "File: " + filename + "is not successfully uploaded"); } knowledgeBase.btnDelete.Click(); IWebElement btnOKConfirmation = PropertiesCollection.driver.FindElement(By.XPath("//*[@id=\"_0_btn_modal\"]")); btnOKConfirmation.Click(); } }
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"); } }
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"); } }
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 Delete_Knowledbase_Item_UserWithoutSO31_WithoutRestriction() { PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Delete 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 strTDRestrictViewing = testdataSummary_Knowledgebase[7]; string strTDUser = testdataSummary_Knowledgebase[11]; string strTDOtherUser = testdataSummary_Knowledgebase[16]; string strTDLogin = testdataSummary_Knowledgebase[20]; /* Identify PeopleId for the user */ string strSQLtblname = "tblPeople"; string strtblselectcolumn = "PeopleID"; string strtblcolumn = "Surname"; string strwherecondn = strTDUser; var conn = new ConnectToSQLServer(); string PeopleID = conn.Select(strSQLtblname, strtblselectcolumn, strtblcolumn, strwherecondn); /* Identify PeopleId for second user */ strwherecondn = strTDOtherUser; conn = new ConnectToSQLServer(); string PeopleIDOther = conn.Select(strSQLtblname, strtblselectcolumn, strtblcolumn, strwherecondn); 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); FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage(); Knowledgebase.Delete_Knowledgebase_Item(strTDTitle, strTDRestrictViewing, PeopleID, PeopleIDOther); System.Threading.Thread.Sleep(5000); string KBItemXPath = null; KBItemXPath = "//*/div/span[contains(.,'" + strTDTitle + "')]"; try { Assert.IsTrue(Knowledgebase.txtKBItem.Displayed); PropertiesCollection.test.Log(Status.Fail, "Knowledgebase Item could not be deleted"); } catch { PropertiesCollection.test.Log(Status.Pass, "Knowledgebase Item deleted"); } }
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"); } }