public void ATC3285_CRMInvestigationMasterCaseConfirmpresenceofFieldsonform() { string investigationMasterCaseNumber; User user = this.environment.GetUser(SecurityRole.Investigations); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsMasterCasesRibbonButton(); InvestigationMasterCaseSearchPage investigationsMasterCaseSearchPage = new InvestigationMasterCaseSearchPage(driver); investigationsMasterCaseSearchPage.ClickNewButton(); InvestigationMasterCasePage investigationMasterCasePage = new InvestigationMasterCasePage(driver); investigationMasterCasePage.SetUnknowInvestigatorValue("Test User"); investigationMasterCasePage.SetClientValue("BLAIR TEST"); //investigationMasterCasePage.SetOwnerValue("IMSTestU04"); investigationMasterCasePage.SetInvestigatorValue("IMSTestU02"); investigationMasterCasePage.ClickSaveButton(); investigationMasterCaseNumber = investigationMasterCasePage.GetInvestigationMasterCaseNumber(); investigationMasterCasePage.ClickSaveCloseButton(); }
public void ATC5286_CRMInvestigationMasterCaseAssociatedCaseStatusChange() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\Investigations.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); MySheet = (Excel.Worksheet)MyBook.Sheets[Properties.Settings.Default.ENVIRONMENT.ToString()]; MyRange = MySheet.UsedRange; //Get specific row for the data int testDataRows = MyRange.Rows.Count; int MyRow = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value.ToString() == "ClientTestData") { MyRow = i; break; } } #endregion string clientName = MyRange.Cells[MyRow, InvestigationSchema.GetColumnIndex(ColumnName.CLIENT_NAME)].Value; //Login in as role User user = this.environment.GetUser(SecurityRole.InvestigationsOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); String HomeWindow = driver.CurrentWindowHandle; homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); // Create new investigation case InvestigationCaseSearchPage investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.ClickNewInvestigationCaseButton(); InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickSaveButton(); String investigationID1 = investigationCasePage.GetInvestigationCaseNumber(); Thread.Sleep(1000); investigationCasePage.ClickSaveCloseButton(); investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.ClickNewInvestigationCaseButton(); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickSaveButton(); String investigationID2 = investigationCasePage.GetInvestigationCaseNumber(); Thread.Sleep(1000); investigationCasePage.ClickSaveCloseButton(); investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); driver = driver.SwitchTo().Window(HomeWindow); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsMasterCasesRibbonButton(); InvestigationMasterCaseSearchPage investigationMasterCasesSearchPage = new InvestigationMasterCaseSearchPage(driver); string BaseWindow = driver.CurrentWindowHandle; investigationMasterCasesSearchPage.ClickNewButton(); InvestigationMasterCasePage investigationMasterCasePage = new InvestigationMasterCasePage(driver); string MasterWindow = driver.CurrentWindowHandle; investigationMasterCasePage.SetClientValue(clientName); investigationMasterCasePage.ClickSaveButton(); String investigationMasterID = investigationMasterCasePage.GetInvestigationMasterCaseNumber(); investigationMasterCasePage.ClickInvestigationCaseAddButton(); investigationMasterCasePage.SetInvestigationCaseNumberToAssociateMaster(investigationID1); investigationMasterCasePage.ClickInvestigationCaseAddButton(); investigationMasterCasePage.SetInvestigationCaseNumberToAssociateMaster(investigationID2); // Confirm user can view the current status and sub status of each linked Investigation Case Table table = new Table(investigationMasterCasePage.GetInvestigationCasesSearchResultTable()); Assert.AreEqual("New case", table.GetCellValue("Case Number", investigationID1, "Investigation Status")); Assert.AreEqual("Creation", table.GetCellValue("Case Number", investigationID1, "Investigation Sub Status")); Assert.AreEqual("New case", table.GetCellValue("Case Number", investigationID2, "Investigation Status")); Assert.AreEqual("Creation", table.GetCellValue("Case Number", investigationID2, "Investigation Sub Status")); table.ClickCell("Case Number", investigationID2, "Case Number"); investigationMasterCasePage.ClickInvestigationCaseAssociatedView(); driver = driver.SwitchTo().Window(BaseWindow); // Confirm 'Investigation Case Associated View' displayed Assert.AreEqual("Investigation Case Associated View", investigationMasterCasePage.GetCurrentView()); // Select associated Investigation Case to update investigationMasterCasePage.SwitchToMasterCasePageFrame(); table = new Table(investigationMasterCasePage.GetInvestigationCasesAssociatedViewTable()); table.ClickCellValue("Case Number", investigationID2, "Case Number"); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); string CaseWindow = driver.CurrentWindowHandle; investigationCasePage.ClickRunWorkflowButton(); // From 'Run Workflow' select 'Update Status: New Case - Creation' process table = new Table(investigationCasePage.GetProcessSearchResultTable()); table.ClickCell("Process Name", "Update Status: New Case - Creation", "Created On"); investigationCasePage.ClickDialogAddButton(); Thread.Sleep(400); investigationCasePage.ClickConfirmApplicationOfWindow(BaseWindow); driver = driver.SwitchTo().Window(CaseWindow); Thread.Sleep(400); investigationCasePage.ClickSaveCloseButton(); investigationMasterCasePage = new InvestigationMasterCasePage(driver); investigationMasterCasePage.ClickSaveCloseButton(); investigationMasterCasesSearchPage = new InvestigationMasterCaseSearchPage(driver); investigationMasterCasesSearchPage.SearchRecord(investigationMasterID); table = new Table(investigationMasterCasesSearchPage.GetSearchResultTable()); table.ClickCellContainsValueEnterRow("Master Case ID", investigationMasterID, "Master Case ID"); investigationMasterCasePage = new InvestigationMasterCasePage(driver); table = new Table(investigationMasterCasePage.GetInvestigationCasesSearchResultTable()); table.ClickCellValue("Case Number", investigationID2, "Case Number"); // Confirm that Status - sub statuses updated to 'New Case - Initial assessment' investigationCasePage = new InvestigationCasePage(driver); StringAssert.Contains(investigationCasePage.GetStatus(), "New case"); StringAssert.Contains(investigationCasePage.GetSubStatus(), "Initial assessment"); table = new Table(investigationCasePage.GetActivitiesHeaderTable()); table.ClickTableColumnHeader("Subject"); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); // Confirm mandatory tasks for Investigation Cases updated are created for that status and sub status StringAssert.Contains(table.GetCellContainsValue("Subject", 1), investigationID2 + ": Add parties"); StringAssert.Contains(table.GetCellContainsValue("Subject", 2), investigationID2 + ": Allocate"); StringAssert.Contains(table.GetCellContainsValue("Subject", 3), investigationID2 + ": Carry out initial assessment"); StringAssert.Contains(table.GetCellContainsValue("Subject", 4), investigationID2 + ": Scan documents"); StringAssert.Contains(table.GetCellContainsValue("Subject", 5), investigationID2 + ": Submit for initial assessment"); Assert.AreEqual(5, table.GetRowCount() - 1, "Additional activities are displayed!!!!"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC4448_CRMInvestigationVerifyFilterOnInvestigatorName() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\Investigations.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); MySheet = (Excel.Worksheet)MyBook.Sheets[Properties.Settings.Default.ENVIRONMENT.ToString()]; MyRange = MySheet.UsedRange; //Get specific row for the data int testDataRows = MyRange.Rows.Count; int MyRow = 0; for (int i = 2; i <= testDataRows; i++) { if (MyRange.Cells[i, 1].Value.ToString() == "ClientTestData") { MyRow = i; break; } } #endregion string clientName = MyRange.Cells[MyRow, InvestigationSchema.GetColumnIndex(ColumnName.CLIENT_NAME)].Value; //Login in as role User user = this.environment.GetUser(SecurityRole.Investigations); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); string HomeWindow = driver.CurrentWindowHandle; homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); // Create investigation case 1 with Investigator as IMSTestU06" InvestigationCaseSearchPage investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); string BaseWindow = driver.CurrentWindowHandle; investigationCaseSearchPage.ClickNewInvestigationCaseButton(); InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); string user06 = "IMSTestU06"; string user04 = "IMSTestU04"; investigationCasePage.ClickPageTitle(); Assert.IsTrue(investigationCasePage.GetInvestigatorSearchElementText(user06)); investigationCasePage.ClickSaveButton(); string investigationID1 = investigationCasePage.GetInvestigationCaseNumber(); Console.WriteLine(investigationID1); investigationCasePage.ClickSaveCloseButton(); // Create investigation case 2 with Investigator as IMSTestU06" driver = driver.SwitchTo().Window(BaseWindow); investigationCaseSearchPage.ClickNewInvestigationCaseButton(); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); Assert.IsTrue(investigationCasePage.GetInvestigatorSearchElementText(user06)); investigationCasePage.ClickSaveButton(); string investigationID2 = investigationCasePage.GetInvestigationCaseNumber(); Console.WriteLine(investigationID2); investigationCasePage.ClickSaveCloseButton(); Thread.Sleep(1000); // Create one general case where owner = same common investigator from above point driver = driver.SwitchTo().Window(HomeWindow); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsGeneralCasesRibbonButton(); InvestigationGeneralCaseSearchPage investigationsGeneralCasesPage = new InvestigationGeneralCaseSearchPage(driver); investigationsGeneralCasesPage.ClickNewGeneralCaseButton(); InvestigationGeneralCasePage investigationGeneralCasePage = new InvestigationGeneralCasePage(driver); investigationGeneralCasePage.ClickPageTitle(); investigationGeneralCasePage.SetTitle("Client D"); investigationGeneralCasePage.SetClientName(clientName); investigationGeneralCasePage.SetType("Enquiry"); investigationGeneralCasePage.SetInvestigatorSearchElementText(user06); investigationGeneralCasePage.ClickSaveButton(); string generalCaseID = investigationGeneralCasePage.GetGeneralCaseNumber(); Console.WriteLine(generalCaseID); investigationGeneralCasePage.ClickSaveCloseButton(); // Ensure an investigation master case exists with the same common {Investigator} as above driver = driver.SwitchTo().Window(HomeWindow); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsMasterCasesRibbonButton(); InvestigationMasterCaseSearchPage investigationMasterCasesSearchPage = new InvestigationMasterCaseSearchPage(driver); investigationMasterCasesSearchPage.ClickNewButton(); InvestigationMasterCasePage investigationMasterCasePage = new InvestigationMasterCasePage(driver); investigationMasterCasePage.SetInvestigatorValue(user06); investigationMasterCasePage.ClickSaveButton(); string masterCasrID = investigationMasterCasePage.GetInvestigationMasterCaseNumber(); Console.WriteLine(masterCasrID); // Close the current window and login with Investigation Business Admin driver.Close(); driver = null; this.TestSetup(); user = this.environment.GetUser(SecurityRole.InvestigationsBusinessAdmin); new LoginDialog().Login(user.Id, user.Password); // Verify the Support Officers queue homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); // Ensure at least one other investigations case exists with a different {Investigator} but {Owner} = same common investigator as above investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.ClickNewInvestigationCaseButton(); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); Assert.IsTrue(investigationCasePage.GetInvestigatorSearchElementText(user04)); investigationCasePage.ClickSaveButton(); string investigationID3 = investigationCasePage.GetInvestigationCaseNumber(); Console.WriteLine(investigationID3); investigationCasePage.ClickSaveCloseButton(); investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.SetSearchRecord("IMSTestU06"); Table table = new Table(investigationCaseSearchPage.GetSearchResultTable()); table.ClickCellContainsValue("Investigator", "IMSTestU06", "Investigator"); // Verify that User oage is getting displayed UserPage investigationUserPage = new UserPage(driver); investigationUserPage.ClickPageTitle(); StringAssert.Contains(investigationUserPage.GetFullName(), "IMSTestU06"); //Navigate to client phone numbers homePage.HoverClientXRibbonTab(user06); homePage.ClickInvestigatorXCasesRibbonButton(); // Verify the cases displayed for Investigation Business Admin investigationUserPage = new UserPage(driver); StringAssert.Contains(investigationUserPage.GetPageFilterList(), "Investigation Case Associated View"); // Verify Investigation Case 1 is displayed investigationUserPage = new UserPage(driver); investigationUserPage.SetSearchRecord(investigationID1); table = new Table(investigationUserPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Case Number", investigationID1, "Investigator"), user06); StringAssert.Contains(table.GetCellContainsValue("Case Number", investigationID1, "Owner"), user04); // Verify Investigation Case 2 is displayed investigationUserPage = new UserPage(driver); investigationUserPage.SetSearchRecord(investigationID2); table = new Table(investigationUserPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Case Number", investigationID2, "Investigator"), user06); StringAssert.Contains(table.GetCellContainsValue("Case Number", investigationID2, "Owner"), user04); // Verify General case is not displayed investigationUserPage = new UserPage(driver); investigationUserPage.SetSearchRecord(generalCaseID); table = new Table(investigationUserPage.GetSearchResultTable()); Assert.IsTrue(table.GetNoRecordsInTable(), "General case is DISPLAYED!!!!"); // Verify Master case is not displayed investigationUserPage = new UserPage(driver); investigationUserPage.SetSearchRecord(masterCasrID); table = new Table(investigationUserPage.GetSearchResultTable()); Assert.IsTrue(table.GetNoRecordsInTable(), "Master case is DISPLAYED!!!!"); // Verify Master case is not displayed investigationUserPage = new UserPage(driver); investigationUserPage.SetSearchRecord(investigationID3); table = new Table(investigationUserPage.GetSearchResultTable()); Assert.IsTrue(table.GetNoRecordsInTable(), "Investigation case with different Investigator is DISPLAYED!!!!"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6710_CRMMasterCaseInvestigationCaseOptionalTasks() { string INVNumber; User user = this.environment.GetUser(SecurityRole.Investigations); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsMasterCasesRibbonButton(); InvestigationMasterCaseSearchPage investigationMasterCasesSearchPage = new InvestigationMasterCaseSearchPage(driver); investigationMasterCasesSearchPage.ClickNewButton(); InvestigationMasterCasePage investigationMasterCasePage = new InvestigationMasterCasePage(driver); investigationMasterCasePage.ClickSaveButton(); INVNumber = investigationMasterCasePage.GetInvestigationMasterCaseNumber(); investigationMasterCasePage.ClickSaveCloseButton(); investigationMasterCasesSearchPage = new InvestigationMasterCaseSearchPage(driver); investigationMasterCasesSearchPage.SetInvestigationSearchText(INVNumber); Table table = new Table(investigationMasterCasesSearchPage.GetSearchResultTable()); table.ClickCellContainsValueEnterRow("Master Case ID", INVNumber, "Master Case ID"); investigationMasterCasePage = new InvestigationMasterCasePage(driver); investigationMasterCasePage.ClickPageTitle(); investigationMasterCasePage.ClickActivitiesAddButton(); investigationMasterCasePage.ClickCRMToolbar(); string BaseWindow = driver.CurrentWindowHandle; //Records the current window handle investigationMasterCasePage.ClickAddTaskButton("Task"); Thread.Sleep(3000); //Enter Request Party details driver = investigationMasterCasePage.SwitchNewBrowserWithTitle(driver, BaseWindow, "Task"); TaskPage taskPage = new TaskPage(driver); string[] subjects = new string[] { "Relevant address added", "Allocate to investigator", "Relevant bond background searches", "Follow-up request to be sent to complainant(s)", "Request to be sent (compelled by law)", "Follow-up request to be sent to third party", "Visit complainant", "Visit other witness", "Visit subject premises", "Visit other premises", "Visit respondent", "Execute warrant(s)", "Follow-up request to be sent to respondent", "Acknowledgement to be sent to respondent", "Send closure letter to respondent(s)", "Send closure letter to complainant(s)", "Additional investigations required", "Seek executive approval to prosecute", "Issue PIN", "Awaiting PIN referral to SPER" }; foreach (string i in subjects) { taskPage.ClickPageTitle(); Thread.Sleep(2000); taskPage.SetSelectSubjectValue(i); StringAssert.Contains(taskPage.GetSubjectValue(), i); } taskPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); InvestigationCaseSearchPage investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.ClickNewInvestigationCaseButton(); InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); Thread.Sleep(3000); investigationCasePage.ClickSaveButton(); investigationCasePage.GetInvestigationCaseNumber(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickCRMToolbar(); BaseWindow = driver.CurrentWindowHandle; //Records the current window handle investigationCasePage.ClickAddTaskButton("Task"); Thread.Sleep(3000); //Enter Request Party details driver = investigationCasePage.SwitchNewBrowserWithTitle(driver, BaseWindow, "Task"); taskPage = new TaskPage(driver); subjects = new string[] { "Relevant address added", "Allocate to investigator", "Relevant bond background searches", "Follow-up request to be sent to complainant(s)", "Request to be sent (compelled by law)", "Follow-up request to be sent to third party", "Visit complainant", "Visit other witness", "Visit subject premises", "Visit other premises", "Visit respondent", "Execute warrant(s)", "Follow-up request to be sent to respondent", "Acknowledgement to be sent to respondent", "Send closure letter to complainant(s)", "Send closure letter to respondent(s)", "Additional investigations required", "Seek executive approval to prosecute", "Issue PIN", "Awaiting PIN referral to SPER" }; foreach (string i in subjects) { taskPage.ClickPageTitle(); taskPage.SetSelectSubjectValue(i); StringAssert.Contains(taskPage.GetSubjectValue(), i); } taskPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); }