public void ATC4422_CRMTenancyRequestWithNoContributor() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "TR_TestData") { MyRow = i; break; } } #endregion string initialRequestParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(); string initialContribution = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(); string rentalPremises = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(); //Login as RBS user User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //As a RBS Officer, navigate to an Address Detail HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaAddressDetailRibbonButton(); AddressDetailSearchPage addressDetailSearchPage = new AddressDetailSearchPage(driver); addressDetailSearchPage.SetAddressDetailSearchText("MITCHELTON"); Table addressSearchTable = new Table(addressDetailSearchPage.GetSearchResultTable()); addressSearchTable.ClickCellContainsValue("Name", rentalPremises, "Name"); AddressDetailPage addressDetailPage = new AddressDetailPage(driver); //Click on the Tenancy Requests Associated View in the dropdown ribbon menu homePage.HoverAddressDetailRibbonTab(rentalPremises); homePage.ClickTRAddressDetailViewRibbonButton(); addressDetailPage = new AddressDetailPage(driver); string BaseWindow = driver.CurrentWindowHandle; addressDetailPage.ClickAddNewTenancyRequestButton(); addressDetailPage.SwitchNewBrowser(driver, BaseWindow); //Fill in all mandatory details and Click Save&close TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Set {Type} field to Bond Lodgement. tenancyRequestPage.SetRequestTypeListValue("Bond Lodgement"); tenancyRequestPage.PopulateTenancyRequestWithoutRentalPremisesFromAddressDetailAssociatedView( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), initialRequestParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), initialContribution, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetDwellingTypeListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("DWELLING_TYPE")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); string tenancyRequest = tenancyRequestPage.GetRequestNumber(); StringAssert.Contains(tenancyRequest, "TR-BL-", "Validating the Tenancy Request saved with the correct TR no fromat"); tenancyRequestPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); //Open the Tenancy Request which was just created addressDetailPage = new AddressDetailPage(driver); addressDetailPage.SetTenancyRequestSearchText(tenancyRequest); Table tenancyRequestSearchTable = new Table(addressDetailPage.GetTenancyRequestSearchResultTable()); tenancyRequestSearchTable.ClickCellContainsValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); Table requestPartyTable = new Table(tenancyRequestPage.GetRequestPartyTable()); //Confirm the tenancy request has only one contributor i.e initial Request Party Assert.AreEqual(requestPartyTable.GetCellContainsValue("Request Amount",initialContribution,"Client"), initialRequestParty); Assert.AreEqual(1, requestPartyTable.GetRowCount()-1,"Validating only one contributor is avaialble"); UICommon.DoubleClickElement(requestPartyTable.GetCellElementContainsValue("Client", initialRequestParty, "Client"), driver); Thread.Sleep(1000); TenancyRequestPartyPage tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.ClickPageTitle(); //Try to deactivate the contributor. Fails with an error dialog tenancyRequestPartyPage.ClickDeactivateButton(); WarningDialogueFramePage warningPage = new WarningDialogueFramePage(driver); warningPage.ClickProcessBeginButton(); tenancyRequestPartyPage.ClickSaveCloseButton(); //Go back to tenancy request form. The Delete button should not be available for RBS user tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); requestPartyTable = new Table(tenancyRequestPage.GetRequestPartyTable()); Assert.AreEqual(requestPartyTable.GetCellContainsValue("Request Amount", initialContribution, "Client"), initialRequestParty); Assert.AreEqual(1, requestPartyTable.GetRowCount() - 1, "Validating the initial contributor is still avaialble after trying to deactivate"); IWebElement element = requestPartyTable.GetCellElementContainsValue("Client", initialRequestParty, "Request Amount"); Assert.IsFalse(tenancyRequestPage.ClickDeleteButtonIfDisplayed(element),"Validating that delete button not displyed to click"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC4457_CRMPaymentTypefieldforTenancyRequestTestaudithistory() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "TR_TestData") { MyRow = i; break; } } #endregion string managingParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); string tenancyRequestReference; User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.PopulateTenancyRequestValidationSuccessful( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), managingParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); tenancyRequestReference = tenancyRequestPage.GetRequestNumber(); //Review Audit homePage.HoverTRRibbonTab(tenancyRequestReference); homePage.ClickAuditRibbonButton(); tenancyRequestPage = new TenancyRequestPage(driver); Table table = new Table(tenancyRequestPage.GetAuditHistoryTable()); string todaysDate = DateTime.Now.ToString("d/MM/yyyy"); StringAssert.Contains(table.GetCellContainsValue("Event", "Create", "Changed Date"), todaysDate); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC3313_CRMInvestigationAddAndDeactivateCaseParty() { User user = this.environment.GetUser(SecurityRole.InvestigationOfficer); new LoginDialog().Login(user.Id, user.Password); string ClientName = "CLIENT CASE" + UICommon.GetRandomString(3); // Create Investigation Case HomePage homePage = new HomePage(driver); string HomeWindowInv = driver.CurrentWindowHandle; homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); // Verify that Investigation Officer is able to record Phone call for Investigation Case InvestigationCaseSearchPage investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.ClickNewInvestigationCaseButton(); // Create new Investigation case InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickSaveButton(); String investigationID = investigationCasePage.GetInvestigationCaseNumber(); string InvWindow = driver.CurrentWindowHandle; IWebDriver ClientDriver = null; // Spawn a new window and open a Client record if (Properties.Settings.Default.BROWSER == BrowserType.Ie) { ClientDriver = new BrowserContext().WebDriver; this.environment = TestEnvironment.GetTestEnvironment(); } ClientDriver.Navigate().GoToUrl(this.environment.Url); new LoginDialog().Login(user.Id, user.Password); // Create new Client Profile homePage = new HomePage(ClientDriver); string HomeWindowClient = ClientDriver.CurrentWindowHandle; homePage.HoverCRMRibbonTab(); homePage.ClickClientServicesRibbonButton(); homePage.HoverClientServicesRibbonTab(); homePage.ClickClientsRibbonButton(); ClientsSearchPage clientsSearchPage = new ClientsSearchPage(ClientDriver); Trace.Listeners.Add(new TextWriterTraceListener("TextWriterOutput.log", "myListener")); Trace.TraceInformation("Add Client Case Party start:" + DateTime.Now.ToString("ddMMyyyyhhmmssffff")); Trace.Flush(); clientsSearchPage.ClickNewClientButton(); ClientPage clientPage = new ClientPage(ClientDriver); clientPage.ClickPageTitle(); clientPage.PopulateNewClient(ClientName); clientPage.ClickSaveCloseButton(); string ClientWindow = ClientDriver.CurrentWindowHandle; // ADD the Client from the second open window as a Case Party to the Investigation Case driver.SwitchTo().Window(InvWindow); investigationCasePage = new InvestigationCasePage(driver); string BaseWindow = driver.CurrentWindowHandle; investigationCasePage.ClickAddCasePartyRecordButton(); investigationCasePage.SwitchNewBrowserWithTitle(driver, BaseWindow, "Case Party"); CasePartyPage casePartyPage = new CasePartyPage(driver); casePartyPage.ClickPageTitle(); casePartyPage.ClickPartyType(); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Bond Contributor"), "Bond Contributor option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Tenant"), "Tenant option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Resident"), "Resident option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Agent"), "Agent option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Lessor"), "Lessor option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Rooming Accommodation Provider"), "Rooming Accommodation Provider option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Student Accommodation Provider"), "Student Accommodation Provider option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Moveable Dwelling Provider"), "Moveable Dwelling Provider option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Community Housing Organisation"), "Community Housing Organisation option not seen!!!"); Assert.IsTrue(casePartyPage.VerifyCasePartyTypeExists("Owner"), "Owner option not seen!!!"); Trace.Listeners.Add(new TextWriterTraceListener("TextWriterOutput.log", "myListener")); Trace.TraceInformation("Add Case Party end:" + DateTime.Now.ToString("ddMMyyyyhhmmssffff")); Trace.Flush(); casePartyPage.ClickPageTitle(); casePartyPage.SetClientName(ClientName); casePartyPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); investigationCasePage.CheckForErrors(); investigationCasePage.ClickSaveCloseButton(); // Verify new Case Management Activity is shown in the Investigation Case which documents that the Case Party was added and by whom. investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.SetSearchRecord(investigationID); Table table = new Table(investigationsCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); driver = driver.SwitchTo().Window(BaseWindow); investigationCasePage.ClickPageTitle(); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Case party " + ClientName + " added to case " + investigationID, "Activity Status"), "Completed"); InvWindow = driver.CurrentWindowHandle; //Client window ClientDriver = ClientDriver.SwitchTo().Window(ClientWindow); clientsSearchPage = new ClientsSearchPage(ClientDriver); clientsSearchPage.SetClientSearchText(ClientName); table = new Table(clientsSearchPage.GetSearchResultTable()); table.ClickCellValue("Full Name", ClientName, "Full Name"); clientPage = new ClientPage(ClientDriver); Thread.Sleep(3000); clientPage.ClickSeeRecordsAssociatedWithThisViewButton("Activities"); clientPage.SwitchToFrame(); clientPage.SetPageFilterList("All Activities", ClientDriver); clientPage.SetFilterOnList("All", ClientDriver); table = new Table(clientPage.GetActivitiesAssociatedViewTable(ClientDriver)); StringAssert.Contains(table.GetCellValue("Subject", "Case party " + ClientName + " added to case " + investigationID, "Activity Status"), "Completed"); ClientWindow = ClientDriver.CurrentWindowHandle; // DEACTIVATE the Case Party by opening the Case Party Associated View and running the Dialog. driver = driver.SwitchTo().Window(InvWindow); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); table = new Table(investigationCasePage.GetCasePartyTable()); table.ClickCellContainsValueEnterRow("Client", ClientName, "Party Type"); casePartyPage = new CasePartyPage(driver); casePartyPage.ClickPageTitle(); casePartyPage.ClickSaveButton(); casePartyPage.ClickStartDialog(); table = new Table(casePartyPage.GetProcessSearchResultTable()); table.ClickCell("Process Name", "INV: Deactivate case party", "Created On"); BaseWindow = driver.CurrentWindowHandle; casePartyPage.ClickDialogAddButton(); driver = UICommon.SwitchToNewBrowserWithTitle(driver, BaseWindow, "INV:"); INVPage INV = new INVPage(driver); INV.ClickNextButton(); INV.ClickFinishButton(); driver = driver.SwitchTo().Window(BaseWindow); casePartyPage.ClickSaveCloseButton(); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Case party " + ClientName + " removed from case " + investigationID, "Activity Status"), "Completed"); // A new Case Management Activity is shown in the Client which documents that the Case Party was removed and by whom. ClientDriver = ClientDriver.SwitchTo().Window(ClientWindow); ClientDriver = ClientDriver.SwitchTo().Window(HomeWindowClient); homePage.HoverCRMRibbonTab(); homePage.ClickClientServicesRibbonButton(); homePage.HoverClientServicesRibbonTab(); homePage.ClickClientsRibbonButton(); clientsSearchPage = new ClientsSearchPage(ClientDriver); clientsSearchPage.SetClientSearchText(ClientName); table = new Table(clientsSearchPage.GetSearchResultTable()); table.ClickCellValue("Full Name", ClientName, "Full Name"); clientPage = new ClientPage(ClientDriver); clientPage.ClickPageTitle(); clientPage.ClickSeeRecordsAssociatedWithThisViewButton("Activities"); clientPage.SwitchToFrame(); clientPage.SetPageFilterList("All Activities", ClientDriver); clientPage.SetFilterOnList("All", ClientDriver); table = new Table(clientPage.GetActivitiesAssociatedViewTable(ClientDriver)); StringAssert.Contains(table.GetCellValue("Subject", "Case party " + ClientName + " removed from case " + investigationID, "Activity Status"), "Completed"); }
public void ATC6707_CRMInvestigationNewCaseTasksInOutlook() { User user = this.environment.GetUser(SecurityRole.InvestigationsOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); InvestigationCaseSearchPage investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.ClickNewInvestigationCaseButton(); // Create new case and validate Status and Substatus fields InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickSaveButton(); String caseNumber = investigationCasePage.GetInvestigationCaseNumber(); investigationCasePage.ClickSaveCloseButton(); // Search for the newly created Investigation Case investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.SetInvestigationSearchText(caseNumber); Table table = new Table(investigationsCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", caseNumber, "Case Number"); // Validate the activity created for New Investigation case investigationCasePage = new InvestigationCasePage(driver); StringAssert.Contains(investigationCasePage.GetInvestigationCaseNumber(), caseNumber); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", caseNumber + ": Scan documents", "Activity Status"), "Open"); StringAssert.Contains(table.GetCellContainsValue("Subject", caseNumber + ": Add parties", "Activity Status"), "Open"); StringAssert.Contains(table.GetCellContainsValue("Subject", caseNumber + ": Submit for initial assessment", "Activity Status"), "Open"); // Navigate to Outlook and verify the task - Paul }
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 ATC3309_CRMInvestigationVerifyOfficerCanRecordPhoneCalls() { #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; User user = this.environment.GetUser(SecurityRole.InvestigationOfficer); new LoginDialog().Login(user.Id, user.Password); // Create Investigation Case HomePage homePage = new HomePage(driver); string HomeWindow = driver.CurrentWindowHandle; homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); // Verify that Investigation Officer is able to record Phone call for Investigation Case InvestigationCaseSearchPage investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.ClickNewInvestigationCaseButton(); // Create new case InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); string BaseWindow = driver.CurrentWindowHandle; investigationCasePage.ClickSaveButton(); String investigationID = investigationCasePage.GetInvestigationCaseNumber(); //Phone Call investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Phone Call"); driver = investigationCasePage.SwitchNewBrowserWithTitle(driver, BaseWindow, "Phone Call"); PhoneCallPage phoneCall = new PhoneCallPage(driver); phoneCall.ClickPageTitle(); phoneCall.SetSelectSubjectValue("Bond balance enquiry"); phoneCall.SetSubject("Test 3309 Phone Call"); phoneCall.SetRecipient(clientName); phoneCall.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); investigationCasePage.CheckForErrors(); investigationCasePage.ClickPageTitle(); Table table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3309 Phone Call", "Owner"), "IMSTestU03"); table.ClickCellValue("Subject", "Test 3309 Phone Call", "Subject"); phoneCall = new PhoneCallPage(driver); phoneCall.SwitchFrame(); StringAssert.Contains(phoneCall.GetSelectSubjectValue(), "Bond balance enquiry"); StringAssert.Contains(phoneCall.GetSubjectValue(), "Test 3309 Phone Call"); StringAssert.Contains(phoneCall.GetRecipientValue(), clientName); StringAssert.Contains(phoneCall.GetSenderValue(), user.Id); // Verify that Investigation Officer is able to record Phone call for Client driver = driver.SwitchTo().Window(HomeWindow); homePage.HoverCRMRibbonTab(); homePage.ClickClientServicesRibbonButton(); homePage.HoverClientServicesRibbonTab(); homePage.ClickClientsRibbonButton(); ClientsSearchPage clientsSearchPage = new ClientsSearchPage(driver); clientsSearchPage.ClickNewClientButton(); ClientPage clientPage = new ClientPage(driver); BaseWindow = driver.CurrentWindowHandle; clientPage.ClickPageTitle(); clientPage.PopulateNewClient("Client Phone Record"); clientPage.ClickSaveButton(); clientPage.ClickActivitiesAddButton(); clientPage.ClickAddActivity("Phone Call"); Thread.Sleep(3000); driver = clientPage.SwitchNewBrowser(driver, BaseWindow, "Phone Call"); phoneCall = new PhoneCallPage(driver); phoneCall.ClickPageTitle(); phoneCall.SetSelectSubjectValue("Bond balance enquiry"); phoneCall.SetSubject("Test 3309 Client Phone Call"); phoneCall.SetRecipient(clientName); phoneCall.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); phoneCall.CheckForErrors(); clientPage.ClickPageTitle(); table = new Table(clientPage.GetActivitiesTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3309 Client Phone Call", "Owner"), "IMSTestU03"); table.ClickCellValue("Subject", "Test 3309 Client Phone Call", "Subject"); phoneCall = new PhoneCallPage(driver); StringAssert.Contains(phoneCall.GetSelectSubjectValue(), "Bond balance enquiry"); StringAssert.Contains(phoneCall.GetSubjectValue(), "Test 3309 Client Phone Call"); StringAssert.Contains(phoneCall.GetRecipientValue(), clientName); StringAssert.Contains(phoneCall.GetSenderValue(), user.Id); // Verify that Investigation Officer is able to record Phone call for General Case homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsGeneralCasesRibbonButton(); InvestigationGeneralCaseSearchPage invGeneralCaseSearchPage = new InvestigationGeneralCaseSearchPage(driver); invGeneralCaseSearchPage.ClickNewGeneralCaseButton(); InvestigationGeneralCasePage investigationGeneralCasePage = new InvestigationGeneralCasePage(driver); BaseWindow = driver.CurrentWindowHandle; investigationGeneralCasePage.ClickPageTitle(); investigationGeneralCasePage.SetTitle("New General Case"); investigationGeneralCasePage.SetClientName(clientName); investigationGeneralCasePage.SetType("Complaint"); investigationGeneralCasePage.ClickSaveButton(); investigationGeneralCasePage.ClickActivitiesAddButton(); investigationGeneralCasePage.ClickAddActivity("Phone Call"); driver = investigationGeneralCasePage.SwitchNewBrowserWithTitle(driver, BaseWindow, "Phone Call"); phoneCall = new PhoneCallPage(driver); phoneCall.ClickPageTitle(); phoneCall.SetSelectSubjectValue("Bond balance enquiry"); phoneCall.SetSubject("Test 3309 General Case Phone Call"); phoneCall.SetRecipient(clientName); phoneCall.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); phoneCall.CheckForErrors(); investigationGeneralCasePage.ClickPageTitle(); table = new Table(investigationGeneralCasePage.GetActivitiesTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3309 General Case Phone Call", "Owner"), "IMSTestU03"); table.ClickCellValue("Subject", "Test 3309 General Case Phone Call", "Subject"); phoneCall = new PhoneCallPage(driver); StringAssert.Contains(phoneCall.GetSelectSubjectValue(), "Bond balance enquiry"); StringAssert.Contains(phoneCall.GetSubjectValue(), "Test 3309 General Case Phone Call"); StringAssert.Contains(phoneCall.GetRecipientValue(), clientName); StringAssert.Contains(phoneCall.GetSenderValue(), user.Id); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6738_RaiseExceptionInvalidKeyword() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "6362") { MyRow = i; break; } } #endregion string initialRequestParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(); string initialContribution = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(); string rentalPremises = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(); //Login as RBS user User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); //(Template) - Create new Tenancy Request (Bond Lodgement) tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Set {Type} field to Bond Lodgement. tenancyRequestPage.SetRequestTypeListValue("Bond Lodgement"); /*Select 'Australian Physical' as the Type.Enter an address into the fields on the Address Detail record. As part of the address that you enter, Type in the word 'Garage' into the 'Complex Unit Number' field Click on the Save & Close button*/ string[] address = rentalPremises.Split(','); string complexunitno = address[0]; string roadno = address[1].Split(' ')[1]; string roadname = address[1].Split(' ')[2]; string locality = address[2].Split(' ')[1] + "," + address[3] + "," + address[4]; tenancyRequestPage.CreateNewAddress(roadno,roadname,locality,"","",complexunitno); tenancyRequestPage = new TenancyRequestPage(driver); //Select the mandatory fields for the Tenancy Request.Add a new Request Party whose contribution amount is the same as the Amount Paid with Lodgement tenancyRequestPage.PopulateTenancyRequestWithoutRentalPremisesFromAddressDetailAssociatedView( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), initialRequestParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), initialContribution, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetDwellingTypeListValue("House"); //Save the Tenancy Request tenancyRequestPage.ClickSaveButton(); string tenancyrequest = tenancyRequestPage.GetRequestNumber(); //Set the status of the Tenancy Request to be 'Ready for Validation' Validation process for the Tenancy Request is started tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); Thread.Sleep(3000); //The status of the Tenancy Request should be set to Validation failed StringAssert.Contains(tenancyRequestPage.GetStatusReason(), "Validation failed"); //Check the Queue Reasons of the Tenancy Request.There should be a queue reason that exists which is for 'Invalid address: Invalid key word detected' //tenancyRequestPage.ClickQueueReasons(); Table queueReasonTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueReasonTable.GetCellContainsValue("Reason", "Invalid address : Invalid keyword detected", "Status Reason"), "To be resolved"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC3342_CRMInvestigationTestActivitiesCreatedBySelectingSubStatus() { InvestigationCaseSearchPage investigationCaseSearchPage; InvestigationCasePage investigationCasePage; string investigationID; //Login in as role User user = this.environment.GetUser(SecurityRole.Investigations); new LoginDialog().Login(user.Id, user.Password); string[] Status = new string[] { "New case", "Investigation current", "Investigation current" , "Investigation current", "Investigation current", "Investigation current", "Investigation current", "Case finalisation", "Case finalisation", "Case finalisation"}; string[] SubStatus = new string[] { "Initial assessment", "Conducting background searches", "Requesting information from complainant(s)" ,"Requesting information from third parties", "Search warrant(s) required", "Allegations to be put to respondent(s)", "Seeking legal advice", "Case closed discussion", "Educating respondent(s)", "Prosecution required"}; string[] Activities0 = { "Carry out initial assessment", "Allocate"}; string[] Activities1 = { "Conduct respondent(s) background searches", "Conduct complainant(s) background searches", "Conduct relevant dispute searches", "Conduct relevant premises background searches" }; string[] Activities2 = { "Send request for information to complainant(s)", "Receive response from complainant" }; string[] Activities3 = { "Send request for information to third parties", "Receive response from third parties" }; string[] Activities4 = {"Discuss with Manager", "Prepare warrant application(s)", "Receive approval of warrant(s)"}; string[] Activities5 = { "Send letter of allegations to respondent", "Receive response from respondent" }; string[] Activities6 = { "Discuss with SIO or Manager", "Prepare request for legal advice", "Receive legal advice" }; string[] Activities7 = { "Conduct closure discussion", "Record closure discussion outcome" }; string[] Activities8 = { "Send educative letter to respondent(s)" }; string[] Activities9 = { "Prepare brief of evidence", "Seek legal endorsement", "Receive legal advice" }; HomePage homePage = new HomePage(driver); String HomeWindow = driver.CurrentWindowHandle; for (int i = 0; i < Status.Length; i++) { homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); String BaseWindow = driver.CurrentWindowHandle; investigationCaseSearchPage.ClickNewInvestigationCaseButton(); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickSaveButton(); investigationID = investigationCasePage.GetInvestigationCaseNumber(); investigationCasePage.ClickSaveCloseButton(); // Search for the Investigation Case ID investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.SetSearchRecord(investigationID); Table table = new Table(investigationCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.SetStatus(Status[i]); investigationCasePage.ClickPageTitle(); investigationCasePage.SetSubStatus(SubStatus[i]); investigationCasePage.ClickSaveCloseButton(); // Search for the Investigation Case ID investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.SetSearchRecord(investigationID); table = new Table(investigationCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); // Verify the Activities created driver.Navigate().Refresh(); Thread.Sleep(1000); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.SetPageFilterList("All Activities"); Thread.Sleep(1000); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); string[] ActivityArray = {""}; switch (i) { case 0: ActivityArray = Activities0; break; case 1: ActivityArray = Activities1; break; case 2: ActivityArray = Activities2; break; case 3: ActivityArray = Activities3; break; case 4: ActivityArray = Activities4; break; case 5: ActivityArray = Activities5; break; case 6: ActivityArray = Activities6; break; case 7: ActivityArray = Activities7; break; case 8: ActivityArray = Activities8; break; case 9: ActivityArray = Activities9; break; } for (int j = 0; j < ActivityArray.Length; j++) { StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + ": " + ActivityArray[j], "Activity Status"), "Open"); } driver.SwitchTo().Window(HomeWindow); } }
public void ATC6362a_E2ESingleBPAYCancelTenancyRequest() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "6362") { MyRow = i; break; } } #endregion User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); string managingParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); string initialRequestParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(); /*Data prep: 1 x Address Detail record including the word "Garage"; 1 x Tenancy Request (Bond Lodgment) record at "New" that will fail address validation for invalid keyword (i.e. using prepared address), not already associated to a Tenancy, not associated to a batch, Amount Paid with Lodgement matches Sum of Contributions, Managing Party client that does not already exist within AX; n x Tenancy Request Party records associated to the Tenancy Request using Client records that do not already exist within AX*/ TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.PopulateTenancyRequestWithNoInitialAndManagingParty( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.CreateNewClient(managingParty); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.SetInitialRequestPartyWithSearch(initialRequestParty); tenancyRequestPage.SetDwellingTypeListValue("House"); tenancyRequestPage.ClickSaveButton(); string tenancyRequest = tenancyRequestPage.GetRequestNumber(); StringAssert.Contains(tenancyRequest, "TR-BL-", "Validating the Tenancy Request saved with the correct TR no fromat"); tenancyRequestPage.ClickSaveCloseButton(); //Reopen the record and change the status reason to Ready for Validation and save.The record should show an exception with Invalid Keyword tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); Table table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveCloseButton(); //Navigate to Queue - BL failed validation homePage.HoverRBSRibbonTab(); homePage.ClickRtaQueuesButton(); QueueSearchPage queuePage = new QueueSearchPage(driver); queuePage.SetPageFilterList("All Items"); queuePage.SetQueue("Bond lodgement failed validation"); Table queueTable = new Table(queuePage.GetSearchResultTable()); //Open the Tenancy Request from the queue.Tenancy Request record displayed, status reason "Validation failed"at least one Request Queue Reason record created for invalid address keyword with status reason "To be resolved" queueTable.ClickCellContainsValue("Title", tenancyRequest, "Title"); tenancyRequestPage = new TenancyRequestPage(driver); StringAssert.Contains(tenancyRequestPage.GetValidationStatusReason(), "Validation failed", "Validation should fail when invalid keyword entered in address details"); //tenancyRequestPage.ClickQueueReasons(); Table queueReasonTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueReasonTable.GetCellContainsValue("Reason", "Invalid keyword detected", "Status Reason"), "To be resolved"); //De-activate the Tenancy Request and refresh the record.Tenancy Request record updated with Status "Inactive", Status Reason "Cancelled", Tenancy not populated tenancyRequestPage.ClickDeactivateButton(); WarningDialogueFramePage warningPage = new WarningDialogueFramePage(driver); warningPage.ClickProcessBeginButton(); Thread.Sleep(5000); tenancyRequestPage = new TenancyRequestPage(driver); Assert.AreEqual(tenancyRequestPage.GetStatusReason(), "Cancelled", "Validating that TR:" + tenancyRequest + " Status Reason becomes Cancelled after deactivating the record"); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); //Validate whether TR found in the list of recent Inactive Tenancy Requests tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetPageFilterList("Inactive Tenancy Requests"); //Table tenancyRequestSearchHeaderTable = new Table(tenancyRequestSearchPage.GetHeaderSearchResultTable()); //tenancyRequestSearchHeaderTable.ClickTableColumnHeader("Created On"); // tenancyRequestSearchHeaderTable.ClickTableColumnHeader("Created On"); Table tenancyRequestSearchTable = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(tenancyRequestSearchTable.GetCellContainsValue("Name", tenancyRequest, "Name"), tenancyRequest,"Validating the inactive tenancy request table has the deactivated tenancy request"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6708_CRMDistributeAmountForContributors() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "6708") { MyRow = i; break; } } #endregion string secondContributor = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC1")].Value.ToString(); string thridContributor = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC2")].Value.ToString(); //Login as RBS Operations Standard user role. User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); //Create new Tenancy Request with mandatory fields populated TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); string initialRequestParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(); string initialContribution = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(); tenancyRequestPage.PopulateMandatoryFieldValues( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), initialRequestParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), initialContribution, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); //Save Tenancy Record tenancyRequestPage.ClickSaveButton(); string tenancyRequest = tenancyRequestPage.GetRequestNumber(); //Inspect Screen for Warnings "Warning displays that {Amount Paid with Lodgement} field <> sum of contributors." string warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating the warning appears"); //Click the ribbon button Distribute and Save the record. Warnings should disappear string alertMessage = tenancyRequestPage.ClickDistributeButton(); StringAssert.Contains(alertMessage, "Distribution process has been initiated"); //TODO:This is an issue an extra save dialog pops up and clicking OK button on this. string saveMessage = tenancyRequestPage.GetAlertMessage(); StringAssert.Contains(saveMessage, "Your changes have not been saved"); warningMessage = tenancyRequestPage.GetWarningMessage(); Assert.AreEqual(warningMessage, "","Validating that warning message disappeared"); //Add another contributor and populate amount field with > $1. Save Record. Warning should appear. string BaseWindow = driver.CurrentWindowHandle; //Records the current window handle tenancyRequestPage.ClickAddNewRequestPartyImage(); Thread.Sleep(2000); driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); TenancyRequestPartyPage tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.ClickPageTitle(); tenancyRequestPartyPage.SetClientNameValue(secondContributor); tenancyRequestPartyPage.SetAmountValue("100"); tenancyRequestPartyPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickSaveButton(); //TODO:Issue the waning does not appear without refreshing the record.This is a workaround. homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); Table table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Inspect warning appears warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating that the warning appears"); //Add another contributor and populate amount field with > $1. Save Record. Warning should appear. BaseWindow = driver.CurrentWindowHandle; //Records the current window handle tenancyRequestPage.ClickAddNewRequestPartyImage(); Thread.Sleep(2000); driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.ClickPageTitle(); tenancyRequestPartyPage.SetClientNameValue(thridContributor); tenancyRequestPartyPage.SetAmountValue("100"); tenancyRequestPartyPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickSaveButton(); //Inspect warning appears warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating that the warning appears"); //Click the ribbon button Distribute and Save the record. Warning should disappear. alertMessage = tenancyRequestPage.ClickDistributeButton(); StringAssert.Contains(alertMessage, "Distribution process has been initiated"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickSaveButton(); //Issue the waning does disappear not appear without refreshing the record.This is a workaround. homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Warning disappears warningMessage = tenancyRequestPage.GetWarningMessage(); Assert.AreEqual(warningMessage, "", "Validating that warning message disappeared"); //Modify amount paid with lodgemnt to $1500 and inspect warning appears tenancyRequestPage.SetAmountPaidWithLodgement("1500"); tenancyRequestPage.ClickSaveButton(); warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating that the warning appears"); //TODO:Modify Contibutor amount to be different but still adds up to amount. Inspect warning disappears Table requestPartyTable = new Table(tenancyRequestPage.GetRequestPartyTable()); StringAssert.Contains(requestPartyTable.GetCellContainsValue("Client", secondContributor, "Request Amount"), "400"); BaseWindow = driver.CurrentWindowHandle; UICommon.DoubleClickElement(requestPartyTable.GetCellElementContainsValue("Client", secondContributor, "Client"), driver); Thread.Sleep(1000); driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.ClickPageTitle(); tenancyRequestPartyPage.SetAmountValue("700"); tenancyRequestPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickSaveButton(); //TODO.WArnings does not disappear without refreshing the record. This is a workaround. homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Warning disappears warningMessage = tenancyRequestPage.GetWarningMessage(); Assert.AreEqual(warningMessage, "", "Validating that warning message disappeared"); //Modify amount paid with lodgement to be $900 tenancyRequestPage.SetAmountPaidWithLodgement("900"); tenancyRequestPage.ClickSaveButton(); //Warning appears warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Sum of Request does not equal the amount entered for Amount Paid with Lodgement","Validating that the warning appesrs"); //Click Distribute and save the record. Warning should disappear tenancyRequestPage.ClickDistributeButton(); tenancyRequestPage.ClickSaveButton(); warningMessage = tenancyRequestPage.GetWarningMessage(); Assert.AreEqual(warningMessage, "", "Validating that warning message disappeared"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC4520_RaiseExceptionForExcessBond() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "4520") { MyRow = i; break; } } #endregion //Login as RBS user User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); //(Template) - Create new Tenancy Request (Bond Lodgement) tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Set {Type} field to Bond Lodgement. tenancyRequestPage.SetRequestTypeListValue("Bond Lodgement"); /*Enter details:Details entered - Residential Tenancy - No rent subsidy - rent $700 - amount paId $2801*/ tenancyRequestPage.PopulateTenancyRequestFormBondLodgement( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC1")].Value.ToString()); //Rental subsidy //Save Tenancy Request tenancyRequestPage.ClickSaveButton(); //Update Status Reason to 'Ready for validation' and Save tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); //Confirm Status Reason set to 'Validation failed' StringAssert.Contains(tenancyRequestPage.GetStatusReason(), "Validation failed"); //Confirm Queue reason for excess bond added.Status set to 'To be resolved' tenancyRequestPage.ClickQueueReasons(); Table queueReasonTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueReasonTable.GetCellContainsValue("Reason", "Invalid bond amount : Exceeds maximum bond", "Status Reason"), "To be resolved"); //Confirm Maximum Allowed Bond set correctly //Assert: Maximum Allowed Bond set to $2800 StringAssert.Contains(tenancyRequestPage.GetMaximumAllowedAmount(), "2,800.00"); //TODO:Step is not clear.To be implemented #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6911c_TenancytopupvalidationSameaddresssamemanagingparty() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "6911") { MyRow = i; break; } } #endregion string managepingParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.PopulateTenancyRequestValidationSuccessful( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), managepingParty, MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), (MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value + 50).ToString(), "25", "50", "Top up", MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetTenancyValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("BOND_REF")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); string tenancyrequest = tenancyRequestPage.GetRequestNumber(); MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TR_NUMBER")].Value = tenancyrequest; tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); Thread.Sleep(5000); tenancyRequestPage.ClickSaveButton(); Table table = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(table.GetCellContainsValue("Reason", "Invalid list of Parties", "Tenancy Request"), tenancyrequest); table.ClickCellContainsValueEnterRow("Reason", "Invalid list of Parties", "Status Reason"); TenancyRequestQueueReasonPage tenancyRequestQueueReasonPage = new TenancyRequestQueueReasonPage(driver); tenancyRequestQueueReasonPage.SetStatusReasonValue("Resolved", driver); tenancyRequestQueueReasonPage.ClickSaveCloseButton(); tenancyRequestPage = new TenancyRequestPage(driver); table = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(table.GetCellValue("Tenancy Request", tenancyrequest, "Status Reason"), "Resolved"); //Add a new request party string BaseWindow = driver.CurrentWindowHandle; //Records the current window handle tenancyRequestPage.ClickAddNewRequestPartyImage(); //Enter Request Party details driver = tenancyRequestPage.SwitchNewBrowser(driver, BaseWindow); TenancyRequestPartyPage tenancyRequestPartyPage = new TenancyRequestPartyPage(driver); tenancyRequestPartyPage.SetClientNameValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC1")].Value.ToString()); tenancyRequestPartyPage.SetAmountValue("25"); tenancyRequestPartyPage.ClickSaveCloseButton(); driver = driver.SwitchTo().Window(BaseWindow); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); Assert.AreEqual(tenancyRequestPage.GetValidationStatusReason(), "Validation successful"); tenancyRequestPage.ClickSaveCloseButton(); tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.SetTenancyRequestSearchText(tenancyrequest); Assert.IsTrue(tenancyRequestsSearchPage.GetPaymentRefernceRefreshTable(tenancyrequest)); table = new Table(tenancyRequestsSearchPage.GetSearchResultTable()); table.ClickCellValue("Name", tenancyrequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); table = new Table(tenancyRequestPage.GetPaymentSummaryResultTable()); string referencenumber = table.GetCellValue("Tenancy Request", tenancyrequest, "Reference Number"); MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAY_REF_NUMBER")].Value = referencenumber; StringAssert.Contains(tenancyRequestPage.GetStatusReason(), "Pending Financials"); StringAssert.Contains(tenancyRequestPage.GetFundedStatus(), "Payment pending"); ////Create EFT file with new reference number //MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("OUTFILE")].Value = Utils.BAI2FileCreator.bAI2FileCreator(referencenumber, amountOtherParty); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC3341_CRMInvestigationNewCaseDefaultsToNewCaseStatus() { 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.ClickInvestigationsCasesRibbonButton(); Trace.Listeners.Add(new TextWriterTraceListener("TextWriterOutput.log", "myListener")); Trace.TraceInformation("Create new investigation case start:" + DateTime.Now.ToString("ddMMyyyyhhmmssffff")); Trace.Flush(); InvestigationCaseSearchPage investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.ClickNewInvestigationCaseButton(); // Create new case and validate Status and Substatus fields InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); Assert.AreEqual("New case", investigationCasePage.GetStatus()); Assert.AreEqual("Creation", investigationCasePage.GetSubStatus()); investigationCasePage.ClickSaveButton(); String caseNumber=investigationCasePage.GetInvestigationCaseNumber(); investigationCasePage.ClickSaveCloseButton(); // Search for the newly created Investigation Case investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.SetInvestigationSearchText(caseNumber); Table table = new Table(investigationsCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", caseNumber, "Case Number"); // Validate the activity created for New Investigation case investigationCasePage = new InvestigationCasePage(driver); StringAssert.Contains(investigationCasePage.GetInvestigationCaseNumber(), caseNumber); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", caseNumber+": Scan documents", "Activity Status"), "Open"); StringAssert.Contains(table.GetCellContainsValue("Subject", caseNumber + ": Add parties", "Activity Status"), "Open"); StringAssert.Contains(table.GetCellContainsValue("Subject", caseNumber + ": Submit for initial assessment", "Activity Status"), "Open"); Trace.Listeners.Add(new TextWriterTraceListener("TextWriterOutput.log", "myListener")); Trace.TraceInformation("Create new investigation case end:" + DateTime.Now.ToString("ddMMyyyyhhmmssffff")); Trace.Flush(); }
public void ATC3316_CRMInvestigationVerifyRelatedActivitiesOwnerUpdation() { #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; User user = this.environment.GetUser(SecurityRole.InvestigationOfficer); new LoginDialog().Login(user.Id, user.Password); // Create Investigation Case HomePage homePage = new HomePage(driver); string HomeWindow = driver.CurrentWindowHandle; homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); InvestigationCaseSearchPage investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.ClickNewInvestigationCaseButton(); // Create new case InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); string BaseWindow = driver.CurrentWindowHandle; investigationCasePage.ClickSaveButton(); String investigationID = investigationCasePage.GetInvestigationCaseNumber(); //Email investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Email"); Thread.Sleep(1000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(2000); EmailPage emailPage = new EmailPage(driver); emailPage.ClickPageTitle(); emailPage.SetToValueText(clientName); Thread.Sleep(500); emailPage.SetSubjectValueText("Test 3316 Email"); emailPage.ClickSaveCloseIMG(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); //Fax investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Fax"); Thread.Sleep(1000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(2000); FaxPage faxPage = new FaxPage(driver); faxPage.ClickPageTitle(); faxPage.SetSubjectValue("Test 3316 Fax"); faxPage.ClickSaveCloseButton(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); //Letter investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Letter"); Thread.Sleep(1000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(1000); LetterPage letterPage = new LetterPage(driver); letterPage.ClickPageTitle(); letterPage.SetSubjectValue("Test 3316 Letter"); letterPage.ClickSaveButton(); letterPage.ClickSaveCloseButton(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); //Phone Call investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Phone Call"); Thread.Sleep(1000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(2000); PhoneCallPage phoneCall = new PhoneCallPage(driver); Thread.Sleep(100); phoneCall.ClickPageTitle(); phoneCall.SetSelectSubjectValue("Bond balance enquiry"); phoneCall.SetSubject("Test 3316 Phone Call"); Thread.Sleep(500); phoneCall.SetRecipient(clientName); phoneCall.ClickSaveCloseButton(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); // Client Management Activity investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Client Management Activity"); Thread.Sleep(1000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(2000); ClientManagementActivityPage clientManagementActivityPage = new ClientManagementActivityPage(driver); clientManagementActivityPage.ClickPageTitle(); clientManagementActivityPage.SetSubjectValue("Test 3316 Client Management Activity"); clientManagementActivityPage.ClickSaveCloseButton(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); // Front Counter Contact investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Front Counter Contact"); Thread.Sleep(2000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(1000); FrontCounterContactPage frontCounterContactPage = new FrontCounterContactPage(driver); frontCounterContactPage.SetSubjectValue("Test 3316 Front Counter Contact"); frontCounterContactPage.ClickSaveCloseButton(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); // Task investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddTaskButton("Task"); Thread.Sleep(1000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(500); TaskPage taskPage = new TaskPage(driver); taskPage.ClickPageTitle(); taskPage.SetSelectSubjectValue("Bond existence"); taskPage.ClickSaveCloseButton(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); // Recurring Appointment investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Appointment"); Thread.Sleep(1000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(2000); AppointmentPage appointmentPage = new AppointmentPage(driver); string AppWindow = driver.CurrentWindowHandle; appointmentPage.ClickPageTitle(); appointmentPage.SetStartRange(DateTime.Today.AddDays(1).ToString("dd/MM/yyyy")); appointmentPage.ClickPageTitle(); appointmentPage.ClickRecurrenceButton(); appointmentPage.ClickSetButton(); driver = driver.SwitchTo().Window(AppWindow); appointmentPage = new AppointmentPage(driver); appointmentPage.ClickPageTitle(); appointmentPage.SetSubjectValue("Test 3316 Recurring Appointment"); appointmentPage.ClickSaveCloseButton(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); // Appointment investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddActivity("Appointment"); Thread.Sleep(1000); driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(2000); appointmentPage = new AppointmentPage(driver); appointmentPage.ClickPageTitle(); appointmentPage.SetSubjectValue("Test 3316 Appointment"); appointmentPage.ClickSaveCloseButton(); Thread.Sleep(2000); driver = driver.SwitchTo().Window(BaseWindow); // Change the owner value investigationCasePage.ClickPageTitle(); investigationCasePage.SetOwnerValue("IMSTestU04"); investigationCasePage.ClickSaveCloseButton(); investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.SetSearchRecord(investigationID); Table table = new Table(investigationsCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); driver = driver.SwitchTo().Window(BaseWindow); investigationCasePage.ClickPageTitle(); investigationCasePage.ClickSeeRecordsAssociatedWithThisViewButton("Activities"); Thread.Sleep(1000); investigationCasePage.SetActivitiesSearchText("Test 3316 Email"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3316 Email", "Owner"), "IMSTestU04"); investigationCasePage.SetActivitiesSearchText("Test 3316 Fax"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3316 Fax", "Owner"), "IMSTestU04"); investigationCasePage.SetActivitiesSearchText("Test 3316 Letter"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3316 Letter", "Owner"), "IMSTestU04"); investigationCasePage.SetActivitiesSearchText("Test 3316 Phone Call"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3316 Phone Call", "Owner"), "IMSTestU04"); investigationCasePage.SetActivitiesSearchText("Test 3316 Client Management Activity"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3316 Client Management Activity", "Owner"), "IMSTestU04"); investigationCasePage.SetActivitiesSearchText("Test 3316 Front Counter Contact"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3316 Front Counter Contact", "Owner"), "IMSTestU04"); investigationCasePage.SetActivitiesSearchText(investigationID + ": Bond existence"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + ": Bond existence", "Owner"), "IMSTestU04"); investigationCasePage.SetActivitiesSearchText("Test 3316 Appointment"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3316 Appointment", "Owner"), "IMSTestU04"); investigationCasePage.SetActivitiesSearchText("Test 3316 Recurring Appointment"); table = new Table(investigationCasePage.GetActivitiesAssociatedViewTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3316 Recurring Appointment", "Owner"), "IMSTestU04"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6780_CRMNewTenancyRequestTestResidentialTenancyTest() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "6780") { MyRow = i; break; } } #endregion User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Attemp to save with NO Mandatory data tenancyRequestPage.SetRequestTypeListValue("Bond Lodgement"); tenancyRequestPage.ClickSaveButton(); //StringAssert.StartsWith(tenancyRequestPage.GetRentalPremiseAddressErrorText(), "You must provide a value for Rental Premises."); //Attempt to Enter Invalid Bedroom values tenancyRequestPage.SetNumberOfBedrooms("0"); StringAssert.Contains(tenancyRequestPage.GetAlertMessage(), "You must enter a whole number between 1 and 12."); StringAssert.Contains(tenancyRequestPage.GetAlertMessage(), "You must enter a whole number between 1 and 12."); //Attempt to Enter Invalid Bedoom values tenancyRequestPage.SetNumberOfBedrooms("13"); StringAssert.Contains(tenancyRequestPage.GetAlertMessage(), "You must enter a whole number between 1 and 12."); StringAssert.Contains(tenancyRequestPage.GetAlertMessage(), "You must enter a whole number between 1 and 12."); //Attempt to Enter Invalid Bedroom values tenancyRequestPage.SetNumberOfBedrooms("1"); //StringAssert.Contains(tenancyRequestPage.GetRTAValidationMessage(), "You must"); This needs a ! contrains //Attemp to save with Mandatory data // tenancyRequestPage.PopulateTenancyRequestFormResidentialTenancy("1 THOMAS ST, BIRKDALE, QLD, 4159", "Residential Tenancy", "AMANDA TEST", "3", "AARON BALL", "700", "700", "Initial"); tenancyRequestPage.PopulateTenancyRequestFormResidentialTenancy( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); StringAssert.Equals(tenancyRequestPage.GetRequestNumber(), "TR-BL-"); //Assert the warning message regarding Tenancy Start Date and Total Contribution amount warningMessage = tenancyRequestPage.GetWarningMessage(); StringAssert.Contains(warningMessage, "Tenancy Start is blank, please select a date."); //Fill in start date and check that warning message is removed //tenancyRequestPage.ClickTenancyStartDate(); tenancyRequestPage.SetTenancyStartDate("01/03/2015"); tenancyRequestPage.ClickSaveButton(); //StringAssert.Contains(tenancyRequestPage.GetWarningMessage(),"Tenancy Start is blank, please select a date."); //Assert that Date Bond Received at RTA is read only controlMode = tenancyRequestPage.GetPropertyDataControlModeRTADateReceivedAtRTA(); StringAssert.Equals(controlMode, "locked"); //Assert that Funded Status is read only controlMode = tenancyRequestPage.GetPropertyDataControlModeRTAFundedStatus(); StringAssert.Equals(controlMode, "locked"); String tenancyNumber = tenancyRequestPage.GetRequestNumber(); StringAssert.StartsWith(tenancyNumber, "TR-BL-"); //Assert that saved record can be found in the record grid tenancyRequestPage.ClickSaveCloseButton(); tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.SetTenancyRequestSearchText(tenancyNumber); Table table = new Table(tenancyRequestsSearchPage.GetSearchResultTable()); //Assert that the status reason can be confirmed on the table StringAssert.Equals(table.GetCellValue("Name", tenancyNumber, "Status Reason"), "New"); //Assert that a value in a particular column in a table exists StringAssert.Equals(table.GetCellContainsValue("Name", tenancyNumber, "Amount Bond Paid with Lodgement"), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString()); ////Assert that a search result record can be opened table.ClickCellValue("Name", tenancyNumber, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); StringAssert.Equals(tenancyRequestPage.GetRequestNumber(), tenancyNumber); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC3327_CRMInvestigationCloseCaseWithMultipleOpenCloseActions() { //Login in as role 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.ClickInvestigationsCasesRibbonButton(); // Create new investigation case InvestigationCaseSearchPage investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.ClickNewInvestigationCaseButton(); InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickSaveButton(); string investigationID = investigationCasePage.GetInvestigationCaseNumber(); investigationCasePage.ClickSaveCloseButton(); // Search for the Investigation Case ID investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.SetSearchRecord(investigationID); Table table = new Table(investigationCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); driver.Navigate().Refresh(); Thread.Sleep(1000); investigationCasePage = new InvestigationCasePage(driver); string BaseWindow = driver.CurrentWindowHandle; //Records the current window handle investigationCasePage.SetPageFilterList("All Activities"); Thread.Sleep(1000); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); // Add 1st completed activity investigationCasePage.ClickActivitiesAddButton(); investigationCasePage.ClickAddTaskButton("Task"); //Enter Request Party details driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); TaskPage taskPage = new TaskPage(driver); Thread.Sleep(100); taskPage.ClickPageTitle(); taskPage.SetSelectSubjectValue("Relevant address added"); taskPage.ClickSaveButton(); taskPage.ClickMarkCompleteButton(); driver = driver.SwitchTo().Window(BaseWindow); // Add 2nd completed activity investigationCasePage.ClickPageTitle(); investigationCasePage.ClickActivitiesAddButton(); BaseWindow = driver.CurrentWindowHandle; //Records the current window handle investigationCasePage.ClickAddTaskButton("Task"); //Enter Request Party details driver = investigationCasePage.SwitchNewBrowser(driver, BaseWindow); Thread.Sleep(100); taskPage = new TaskPage(driver); taskPage.ClickPageTitle(); taskPage.SetSelectSubjectValue("Allocate to investigator"); taskPage.ClickSaveButton(); taskPage.ClickMarkCompleteButton(); driver = driver.SwitchTo().Window(BaseWindow); investigationCasePage.ClickPageTitle(); investigationCasePage.SetPageFilterList("All Activities"); Thread.Sleep(1000); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); // Verify that we are having 2 completed and 2 open activities StringAssert.Contains(table.GetCellContainsValue("Subject", "Relevant address added", "Activity Status"), "Completed"); StringAssert.Contains(table.GetCellContainsValue("Subject", "Allocate to investigator", "Activity Status"), "Completed"); StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + ": Scan documents", "Activity Status"), "Open"); StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + ": Add parties", "Activity Status"), "Open"); StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + ": Submit for initial assessment", "Activity Status"), "Open"); Assert.AreEqual(5, table.GetRowCount()-1, "Additional activities seen"); // Now try to close the case investigationCasePage.ClickStartDialogButton(); table = new Table(investigationCasePage.GetProcessSearchResultTable()); table.ClickCell("Process Name", "INV: Close investigation case", "Created On"); BaseWindow = driver.CurrentWindowHandle; //Records the current window handle investigationCasePage.ClickDialogAddButton(); driver = UICommon.SwitchToNewBrowserWithTitle(driver, BaseWindow, "INV:"); INVPage iNVPage = new INVPage(driver); iNVPage.ClickNextButton(); iNVPage.ClickNextButton(); iNVPage.ClickNextButton(); iNVPage.ClickFinishButton(); driver = driver.SwitchTo().Window(BaseWindow); // Now Investigation case is closed.. verify that this case is not seen in active Investigation case investigationCasePage.ClickSaveCloseButton(); investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.SetPageFilterList("Active Investigation Cases"); investigationCaseSearchPage.SetSearchRecord(investigationID); StringAssert.Contains(driver.FindElement(By.ClassName("ms-crm-List-MessageText")).Text, "No Investigation Case records are available in this view."); }
public void ATC6790_TenancyRequestRoomingAccomodation() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "6790") { MyRow = i; break; } } #endregion string initialRequestParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(); string initialContribution = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(); //Login as RBS user User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetPageFilterList("All Tenancy Requests"); Table table = new Table(tenancyRequestSearchPage.GetHeaderSearchResultTable()); table.ClickTableColumnHeader("Created On"); table.ClickTableColumnHeader("Created On"); Table searchTable = new Table(tenancyRequestSearchPage.GetSearchResultTable()); string lastCreatedTenancyReqNo = searchTable.GetCellContainsValue("Name", "TR-BL", "Name"); //(Template) - Create new Tenancy Request (Bond Lodgement) tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Set {Type} field to Bond Lodgement. tenancyRequestPage.SetRequestTypeListValue("Bond Lodgement"); tenancyRequestPage.SetTenancyTypeListValue("Rooming Accommodation"); //Check Dwelling Type field 1. Lookup list filtered to only: [ Boarding House | Supported Accommodation | Student Accommodation off Campus |Studio] Assert.IsTrue(tenancyRequestPage.GetDwellingTypeText("Boarding House")); tenancyRequestPage.ClickPageTitle(); Assert.IsTrue(tenancyRequestPage.GetDwellingTypeText("Supported Accommodation")); tenancyRequestPage.ClickPageTitle(); Assert.IsTrue(tenancyRequestPage.GetDwellingTypeText("Student Accommodation off Campus")); tenancyRequestPage.ClickPageTitle(); Assert.IsTrue(tenancyRequestPage.GetDwellingTypeText("Studio")); //Set Dwelling Type to Boarding House.Number of Bedrooms defaults to 1 and shows as read only tenancyRequestPage.SetDwellingTypeListValue("Boarding House"); tenancyRequestPage.ClickPageTitle(); StringAssert.Contains(tenancyRequestPage.GetNumberOfBedrooms(), "1"); StringAssert.Contains(tenancyRequestPage.GetNumberOfBedroomsProperty("data-controlmode"), "locked"); //Set Dwelling Type to Supported Accommodation.Number of Bedrooms defaults to 1 and shows as read only tenancyRequestPage.SetDwellingTypeListValue("Supported Accommodation"); tenancyRequestPage.ClickPageTitle(); StringAssert.Contains(tenancyRequestPage.GetNumberOfBedrooms(), "1"); StringAssert.Contains(tenancyRequestPage.GetNumberOfBedroomsProperty("data-controlmode"), "locked"); //Set Dwelling Type to Studio Number of Bedrooms defaults to 1 and shows as read only tenancyRequestPage.SetDwellingTypeListValue("Studio"); tenancyRequestPage.ClickPageTitle(); StringAssert.Contains(tenancyRequestPage.GetNumberOfBedrooms(), "1"); StringAssert.Contains(tenancyRequestPage.GetNumberOfBedroomsProperty("data-controlmode"), "locked"); //Set Dwelling Type to Student Accommodation off Campus.Number of Bedrooms defaults to 1 and shows as read only tenancyRequestPage.SetDwellingTypeListValue("Student Accommodation off Campus"); tenancyRequestPage.ClickPageTitle(); StringAssert.Contains(tenancyRequestPage.GetNumberOfBedrooms(), "1"); StringAssert.Contains(tenancyRequestPage.GetNumberOfBedroomsProperty("data-controlmode"), "locked"); //Check Management Type field. Lookup list filtered to only: [ Owner (or can be Lessor/Owner) | Real Estate Agent | Manager/provider | Other ] Assert.IsTrue(tenancyRequestPage.GetTenancyManagementTypeListValue("Lessor/Owner")); Assert.IsTrue(tenancyRequestPage.GetTenancyManagementTypeListValue("Real Estate Agent")); Assert.IsTrue(tenancyRequestPage.GetTenancyManagementTypeListValue("Manager/provider")); Assert.IsTrue(tenancyRequestPage.GetTenancyManagementTypeListValue("Other")); //Set Rental Premise to an address with the following details: [Type, "Australian Physical" | Locality populated | Room/Site Number NOT populated] //Example:"33 SHORE ST, EAST BRISBANE, QLD, 4169" string roadnumber = "33"; string roadname = "SHORE ST"; string locality = "EAST BRISBANE, QLD, 4169"; tenancyRequestPage.CreateNewAddress(roadnumber,roadname,locality); tenancyRequestPage = new TenancyRequestPage(driver); //Populate mandatory fields. Save record. tenancyRequestPage.SetManagingPartyListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString()); tenancyRequestPage.SetTenancyManagementTypeListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetInitialRequestPartyWithSearch(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString()); tenancyRequestPage.SetInitialConrtibution(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString()); tenancyRequestPage.SetAmountPaidWithLodgement(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString()); tenancyRequestPage.SetLodgementTypeListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString()); tenancyRequestPage.ClickSaveButton(); //Record saves. Soft warning (Missing room number): DISPLAYED StringAssert.Contains(tenancyRequestPage.GetWarningMessage(), "The selected address does not have a Room/Site number."); /*The Name field for the Tenancy Request will be populated with 'TR-BL-' and concatenated with the Reference Number field that will be populated with increments of 1 from the most recent Tenancy request record. Example: Given the most recent Tenancy Request name is 'TR-BL-20000016' then this record will be 'TR-BL-20000017'*/ string tenancyRequest = tenancyRequestPage.GetRequestNumber(); StringAssert.Contains(tenancyRequest, "TR-BL", "Validating the newly created tenancy request has TR-BL format"); int oldTRNo = Int32.Parse(lastCreatedTenancyReqNo.Split('-')[2]); int newTRNo = Int32.Parse(tenancyRequest.Split('-')[2]); Assert.AreEqual(oldTRNo + 1, newTRNo, "Validating the TR No is incremented by 1 from the last created TR"); tenancyRequestPage.ClickSaveCloseButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); searchTable = new Table(tenancyRequestSearchPage.GetSearchResultTable()); //Check record in record grid. As updated/entered StringAssert.Contains(searchTable.GetCellContainsValue("Name",tenancyRequest,"Tenancy Type"), "Rooming Accommodation"); StringAssert.Contains(searchTable.GetCellContainsValue("Name",tenancyRequest,"Managing Party"),MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString()); StringAssert.Contains(searchTable.GetCellContainsValue("Name",tenancyRequest,"Rental Premises"),MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString()); StringAssert.Contains(searchTable.GetCellContainsValue("Name", tenancyRequest, "Dwelling Type"), "Student Accommodation off Campus"); StringAssert.Contains(searchTable.GetCellContainsValue("Name", tenancyRequest, "Amount Bond Paid with Lodgement").Replace(",",""), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString()); searchTable.ClickCellContainsValue("Name", tenancyRequest, "Name"); //Remove Rental Premise address. Save record. Record not saved as field is mandatory. tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClearRentalPremisesValue(); tenancyRequestPage.ClickSaveButton(); StringAssert.Contains(tenancyRequestPage.GetRentalPremiseAddressErrorText(), "You must provide a value for Rental Premises."); tenancyRequestPage.ClickPageTitle(); //Set Rental Premise to an address with the following details: [Type, "Australian Physical" | Locality populated | Room/Site Number populated] //Example: "RM 4, 33 SHORE ST, EAST BRISBANE, QLD, 4101" Record saves. Soft warning (Missing room number): NOT DISPLAYED string roomtype = "Room"; string roomno = "4"; tenancyRequestPage.CreateNewAddress(roadnumber, roadname, locality, roomtype, roomno); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickSaveButton(); Assert.IsFalse(tenancyRequestPage.GetWarningMessage().Contains("The selected address does not have a Room/Site number.")); tenancyRequestPage.ClickSaveCloseButton(); //Check record in record grid As updated/entered tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); searchTable = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(searchTable.GetCellContainsValue("Name", tenancyRequest, "Rental Premises"), "RM 4, 33 SHORE ST, EAST BRISBANE, QLD, 4169"); #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 ATC6907_CRMOverrideInvalidKeywordExceptionQueue() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "6907") { MyRow = i; break; } } #endregion User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); //Create new Tenancy Request. Fillup the Rental Premises with some address which has keyword like garage TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.PopulateTenancyRequestValidationSuccessful( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetDwellingTypeListValue("House"); tenancyRequestPage.ClickSaveButton(); string tenancyRequest = tenancyRequestPage.GetRequestNumber(); StringAssert.Contains(tenancyRequest, "TR-BL-", "Validating the Tenancy Request saved with the correct TR no fromat"); tenancyRequestPage.ClickSaveCloseButton(); //Reopen the record and change the status reason to Ready for Validation and save.The record should show an exception with Invalid Keyword tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); Table table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); StringAssert.Contains(tenancyRequestPage.GetValidationStatusReason(), "Validation failed", "Validation should fail when invalid keyword entered in address details"); tenancyRequestPage.ClickQueueReasons(); Table queueTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueTable.GetCellContainsValue("Reason", "Invalid keyword detected", "Reason"), "Invalid keyword detected"); UICommon.DoubleClickElement(queueTable.GetCellElementContainsValue("Reason", "Invalid keyword detected", "Status Reason"),driver); TenancyRequestQueueReasonStatusPage tenancyQueueReasonStatusPage = new TenancyRequestQueueReasonStatusPage(driver); Assert.IsFalse(tenancyQueueReasonStatusPage.GetOverrideCheckBoxValue(),"Validating the override checkbox for Invalid keyword queue reason is available for RBS officer"); //Login with any other user other than RBS operation user and see the override can be done by that user driver.Close(); driver = null; this.TestSetup(); user = this.environment.GetUser(SecurityRole.GeneralStaff); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickQueueReasons(); queueTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueTable.GetCellContainsValue("Reason", "Invalid keyword detected", "Reason"), "Invalid keyword detected"); //Open the exception queue and change the reason to resolved. In the tenancy record select a payment type and change the status reason to Ready for validation - SAVE UICommon.DoubleClickElement(queueTable.GetCellElementContainsValue("Reason", "Invalid keyword detected", "Status Reason"), driver); tenancyQueueReasonStatusPage = new TenancyRequestQueueReasonStatusPage(driver); tenancyQueueReasonStatusPage.SetOverrideCheckBox(true); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); StringAssert.Contains(tenancyRequestPage.GetAlertMessage(), "Your changes have not been saved"); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); //Create new Tenancy Request with fields populated except Payment type tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickQueueReasons(); queueTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueTable.GetCellContainsValue("Reason", "Invalid keyword detected", "Override"), "No"); //Once override is done for that tenancy record for Invalid Keyword exception, it should appear as resolved in the queue in subsequent validations. //Validation should be successful driver.Close(); driver = null; this.TestSetup(); user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickQueueReasons(); queueTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueTable.GetCellContainsValue("Reason", "Invalid keyword detected", "Reason"), "Invalid keyword detected"); UICommon.DoubleClickElement(queueTable.GetCellElementContainsValue("Reason", "Invalid keyword detected", "Status Reason"), driver); tenancyQueueReasonStatusPage = new TenancyRequestQueueReasonStatusPage(driver); tenancyQueueReasonStatusPage.SetOverrideCheckBox(true); tenancyQueueReasonStatusPage.ClickSaveCloseButton(); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.ClickQueueReasons(); queueTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueTable.GetCellContainsValue("Reason", "Invalid keyword detected", "Override"), "Yes"); tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); StringAssert.Contains(tenancyRequestPage.GetValidationStatusReason(), "Validation successful"); queueTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueTable.GetCellContainsValue("Reason", "Invalid keyword detected", "Status Reason"), "Resolved"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6622_CRMInvestigationValidateMandatoryTasksForPendingSubStatus() { //Login in as role User user = this.environment.GetUser(SecurityRole.InvestigationsOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickInvestigationsRibbonButton(); homePage.HoverInvestigationsRibbonTab(); homePage.ClickInvestigationsCasesRibbonButton(); // Create new investigation case InvestigationCaseSearchPage investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.ClickNewInvestigationCaseButton(); InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); string BaseWindow = driver.CurrentWindowHandle; investigationCasePage.ClickPageTitle(); investigationCasePage.SetSubStatus("Case pending"); investigationCasePage.ClickPageTitle(); investigationCasePage.ClickSaveButton(); string investigationID = investigationCasePage.GetInvestigationCaseNumber(); investigationCasePage.ClickSaveCloseButton(); // Search for the Investigation Case ID investigationCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationCaseSearchPage.SetSearchRecord(investigationID); Table table = new Table(investigationCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); driver = driver.SwitchTo().Window(BaseWindow); investigationCasePage.ClickPageTitle(); investigationCasePage.SetPageFilterList("All Activities"); Thread.Sleep(1000); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); // Verify that we are having 2 completed and 2 open activities StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + ": Set future date", "Activity Status"), "Open"); Assert.AreEqual( 1, table.GetRowCount() - 1 , "Additional tasks are created for Case pending status"); }
public void ATC6908_CRMUpdateTenancyRequestPaymentTypeExceptionQueue() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "TR_TestData") { MyRow = i; break; } } #endregion User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); //Create new Tenancy Request with fields populated except Payment type TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.PopulateTenancyRequestWithoutPaymentType( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("NO_ROOMS")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_CONTRIBUTION")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("AMOUNT_PAID_LODGEMENT")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("LODGEMENT_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString()); //Record should save successfully tenancyRequestPage.ClickSaveButton(); string tenancyRequest = tenancyRequestPage.GetRequestNumber(); StringAssert.Contains(tenancyRequest, "TR-BL-","Validating the Tenancy Request saved with the correct TR no fromat"); tenancyRequestPage.ClickSaveCloseButton(); //Open the record again and change the Status Reason to Ready for validation and save tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); Table table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); StringAssert.Contains(table.GetCellValue("Name", tenancyRequest, "Status Reason"), "New"); table.ClickCellValue("Name", tenancyRequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); StringAssert.Contains(tenancyRequestPage.GetValidationStatusReason(), "Validation failed","Validation should fail when payment type is balnk"); //There should be one exception in the queue for Pyment type missing tenancyRequestPage.ClickQueueReasons(); Table queueTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueTable.GetCellContainsValue("Reason", "Payment Type is blank", "Reason"), "Payment Type is blank"); //Open the exception queue and change the reason to resolved. In the tenancy record select a payment type and change the status reason to Ready for validation - SAVE UICommon.DoubleClickElement(queueTable.GetCellElementContainsValue("Reason", "Payment Type is blank", "Status Reason"), driver); TenancyRequestQueueReasonStatusPage tenancyQueueReasonStatusPage = new TenancyRequestQueueReasonStatusPage(driver); StringAssert.Contains(tenancyQueueReasonStatusPage.GetReasonValue(), "Payment Type is blank"); tenancyQueueReasonStatusPage.SetReasonValue("Resolved"); tenancyQueueReasonStatusPage.ClickSaveCloseButton(); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.SetPaymentType("BPay"); tenancyRequestPage.ClickSaveButton(); //Record should be saved and validation should be successful tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveButton(); StringAssert.Contains(tenancyRequestPage.GetValidationStatusReason(), "Validation successful","Validation should be successful after adding payment type"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC3312_CRMInvestigationCaseCloseAndReopen() { //There is only 1 string InvestigationWindowHandle; // for driver string ClientWindowHandle; // for ClientDriver string ClientName = "CLIENT CASE" + UICommon.GetRandomString(3); User user = this.environment.GetUser(SecurityRole.InvestigationOfficer); new LoginDialog().Login(user.Id, user.Password); // Create Investigation Case HomePage homePageInvestigation = new HomePage(driver); InvestigationWindowHandle = driver.CurrentWindowHandle; homePageInvestigation.HoverCRMRibbonTab(); homePageInvestigation.ClickInvestigationsRibbonButton(); homePageInvestigation.HoverInvestigationsRibbonTab(); homePageInvestigation.ClickInvestigationsCasesRibbonButton(); // Verify that Investigation Officer is able to record Phone call for Investigation Case InvestigationCaseSearchPage investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.ClickNewInvestigationCaseButton(); // Create new Investigation case InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickSaveButton(); String investigationID = investigationCasePage.GetInvestigationCaseNumber(); IWebDriver ClientDriver = null; // Spawn a new window and open a Client record if (Properties.Settings.Default.BROWSER == BrowserType.Ie) { ClientDriver = new BrowserContext().WebDriver; this.environment = TestEnvironment.GetTestEnvironment(); } ClientDriver.Navigate().GoToUrl(this.environment.Url); new LoginDialog().Login(user.Id, user.Password); // Create new Client Profile HomePage homePageClient = new HomePage(ClientDriver); ClientWindowHandle = ClientDriver.CurrentWindowHandle; homePageClient.HoverCRMRibbonTab(); homePageClient.ClickClientServicesRibbonButton(); homePageClient.HoverClientServicesRibbonTab(); homePageClient.ClickClientsRibbonButton(); ClientsSearchPage clientsSearchPage = new ClientsSearchPage(ClientDriver); clientsSearchPage.ClickNewClientButton(); ClientPage clientPage = new ClientPage(ClientDriver); clientPage.ClickPageTitle(); clientPage.PopulateNewClient(ClientName); clientPage.ClickSaveCloseButton(); Thread.Sleep(3000); clientsSearchPage = new ClientsSearchPage(ClientDriver); // ADD the Client from the second open window as a Case Party to the Investigation Case driver.SwitchTo().Window(InvestigationWindowHandle); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); investigationCasePage.ClickAddCasePartyRecordButton(); investigationCasePage.SwitchNewBrowserWithTitle(driver, InvestigationWindowHandle, "Case Party"); CasePartyPage casePartyPage = new CasePartyPage(driver); casePartyPage.ClickPageTitle(); casePartyPage.SetClientName(ClientName); casePartyPage.ClickSaveCloseButton(); Thread.Sleep(3000); driver = driver.SwitchTo().Window(InvestigationWindowHandle); investigationCasePage.ClickSaveCloseButton(); // Verify new Case Management Activity is shown in the Investigation Case which documents that the Case Party was added and by whom. investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.SetSearchRecord(investigationID); Table table = new Table(investigationsCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Case party " + ClientName + " added to case " + investigationID, "Activity Status"), "Completed"); StringAssert.Contains(table.GetCellContainsValue("Subject", "Case party " + ClientName + " added to case " + investigationID, "Modified By"), "SRCRM5-TEAdmin Last Name"); //Client window ClientDriver = ClientDriver.SwitchTo().Window(ClientWindowHandle); clientsSearchPage = new ClientsSearchPage(ClientDriver); clientsSearchPage.SetClientSearchText(ClientName); table = new Table(clientsSearchPage.GetSearchResultTable()); table.ClickCellValue("Full Name", ClientName, "Full Name"); clientPage = new ClientPage(ClientDriver); clientPage.ClickSeeRecordsAssociatedWithThisViewButton("Activities"); clientPage.SwitchToFrame(); clientPage.SetPageFilterList("All Activities", ClientDriver); clientPage.SetFilterOnList("All", ClientDriver); table = new Table(clientPage.GetActivitiesAssociatedViewTable(ClientDriver)); StringAssert.Contains(table.GetCellValue("Subject", "Case party " + ClientName + " added to case " + investigationID, "Activity Status"), "Completed"); StringAssert.Contains(table.GetCellValue("Subject", "Case party " + ClientName + " added to case " + investigationID, "Modified By"), "SRCRM5-TEAdmin Last Name"); // Investigation Case window, SELECT Start Dialog and close the Investigation case driver.SwitchTo().Window(InvestigationWindowHandle); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); investigationCasePage.ClickStartDialogButton(); table = new Table(investigationCasePage.GetProcessSearchResultTable()); table.ClickCell("Process Name", "INV: Close investigation case", "Created On"); investigationCasePage.ClickDialogAddButton(); driver = UICommon.SwitchToNewBrowserWithTitle(driver, InvestigationWindowHandle, "INV:"); INVPage iNVPage = new INVPage(driver); iNVPage.ClickNextButton(); iNVPage.ClickNextButton(); iNVPage.ClickNextButton(); iNVPage.ClickFinishButton(); Thread.Sleep(3000); driver = driver.SwitchTo().Window(InvestigationWindowHandle); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickSaveCloseButton(); // Investigation Case is shown as Inactive. A new Case Management Activity is shown in the Investigation Case which documents that the case was closed and by whom. investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.SetPageFilterList("All Investigation Cases"); table = new Table(investigationsCaseSearchPage.GetHeaderSearchResultTable()); table.ClickTableColumnHeader("Case Number"); table = new Table(investigationsCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); StringAssert.Contains(investigationCasePage.GetStatus(), "Closed"); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + " case closed: Act applies-Insufficient evidence", "Activity Status"), "Completed"); StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + " case closed: Act applies-Insufficient evidence", "Modified By"), "IMSTestU03"); // A new Case Management Activity is shown in the Client which documents that the case was closed and by whom. ClientDriver.SwitchTo().Window(ClientWindowHandle); homePageClient.HoverCRMRibbonTab(); homePageClient.ClickClientServicesRibbonButton(); homePageClient.HoverClientServicesRibbonTab(); homePageClient.ClickClientsRibbonButton(); clientsSearchPage = new ClientsSearchPage(ClientDriver); clientsSearchPage.SetClientSearchText(ClientName); table = new Table(clientsSearchPage.GetSearchResultTable()); table.ClickCellValue("Full Name", ClientName, "Full Name"); clientPage = new ClientPage(ClientDriver); clientPage.ClickSeeRecordsAssociatedWithThisViewButton("Activities"); clientPage.SwitchToFrame(); Thread.Sleep(1000); clientPage.SetPageFilterList("All Activities", ClientDriver); clientPage.SetFilterOnList("All", ClientDriver); table = new Table(clientPage.GetActivitiesAssociatedViewTable(ClientDriver)); Console.WriteLine(table.GetRowCount()); StringAssert.Contains(table.GetCellValue("Subject", investigationID + " case closed: Act applies-Insufficient evidence", "Activity Status"), "Completed"); StringAssert.Contains(table.GetCellValue("Subject", investigationID + " case closed: Act applies-Insufficient evidence", "Modified By"), "IMSTestU03"); // In the Investigation Case, SELECT Start Dialog and Re-Open the case driver.SwitchTo().Window(InvestigationWindowHandle); investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); investigationCasePage.ClickStartDialogButton(); table = new Table(investigationCasePage.GetProcessSearchResultTable()); table.ClickCell("Process Name", "INV: Re-open investigation case", "Created On"); investigationCasePage.ClickDialogAddButton(); driver = UICommon.SwitchToNewBrowserWithTitle(driver, InvestigationWindowHandle, "INV:"); iNVPage = new INVPage(driver); iNVPage.ClickNextButton(); iNVPage.ClickNextButton(); iNVPage.ClickFinishButton(); driver = driver.SwitchTo().Window(InvestigationWindowHandle); investigationCasePage = new InvestigationCasePage(driver); homePageInvestigation.HoverInvestigationsRibbonTab(); homePageInvestigation.ClickInvestigationsCasesRibbonButton(); investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.SetSearchRecord(investigationID); table = new Table(investigationsCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); // Investigation Case is shown as Active. A new Case Management Activity is shown in the Investigation Case which documents that the case was closed and by whom. investigationCasePage = new InvestigationCasePage(driver); investigationCasePage.ClickPageTitle(); StringAssert.Contains(investigationCasePage.GetStatus(), "Case finalisation"); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + " case re-opened: Case finalisation - Case closed discussion", "Activity Status"), "Completed"); StringAssert.Contains(table.GetCellContainsValue("Subject", investigationID + " case re-opened: Case finalisation - Case closed discussion", "Modified By"), "IMSTestU03"); // A new Case Management Activity is shown in the Client which documents that the case was reopened and by whom. ClientDriver.SwitchTo().Window(ClientWindowHandle); homePageClient.HoverClientServicesRibbonTab(); homePageClient.ClickClientsRibbonButton(); clientsSearchPage = new ClientsSearchPage(ClientDriver); clientsSearchPage.SetClientSearchText(ClientName); table = new Table(clientsSearchPage.GetSearchResultTable()); table.ClickCellValue("Full Name", ClientName, "Full Name"); clientPage = new ClientPage(ClientDriver); clientPage.ClickSeeRecordsAssociatedWithThisViewButton("Activities"); clientPage.SwitchToFrame(); Thread.Sleep(1000); clientPage.SetPageFilterList("All Activities", ClientDriver); clientPage.SetFilterOnList("All", ClientDriver); table = new Table(clientPage.GetActivitiesAssociatedViewTable(ClientDriver)); StringAssert.Contains(table.GetCellValue("Subject", investigationID + " case re-opened: Case finalisation - Case closed discussion", "Activity Status"), "Completed"); StringAssert.Contains(table.GetCellValue("Subject", investigationID + " case re-opened: Case finalisation - Case closed discussion", "Modified By"), "IMSTestU03"); }
public void ATC9851_CRMChangeOfMPMandatoryFieldsValidationsAC3NoContributorsExceptionOverride() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "9851") { MyRow = i; break; } } #endregion //Login as RBS Claims Officer user role. User user = this.environment.GetUser(SecurityRole.RBSClaimsOfficer); new LoginDialog().Login(user.Id, user.Password); //Navigate to: Rental Bond Services > Tenancy Requests HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); TenancyRequestsSearchPage tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); //Click [+NEW] button. tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Set {Type} field to Change of Managing Party. // tenancyRequestPage.SetRequestTypeListValue("Change of Managing Party"); //Populate all other mandatory fields required for successful validation (as per stories 6792/6793) without a Request Party tenancyRequestPage.PopulateTenancyRequestChangeOfManagingPartyWithoutRequestParty( MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY")].Value.ToString(), MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MISC1")].Value.ToString(), DateTime.Now.ToString("dd/MM/yyyy"), DateTime.Now.ToString("dd/MM/yyyy"), DateTime.Now.ToString("dd/MM/yyyy"), DateTime.Now.ToString("dd/MM/yyyy"), "Signature verified", "Signature verified"); //Click [Save] button to unlock {Status Reason} tenancyRequestPage.ClickSaveButton(); //Set {Status Reason} to "Ready for validation". tenancyRequestPage.SetStatusReason("Ready for validation"); //Click [Save] button. tenancyRequestPage.ClickSaveButton(); //Assert: {Status Reason} becomes "Validation failed". StringAssert.Equals(tenancyRequestPage.GetStatusReason(), "Validation failed"); //Inspect Queue Reasons section. tenancyRequestPage.ClickQueueReasons(); //This may not be necessary. //Assert: An exception queue entry is created with reason type: "At least one contributor required" Table table = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(table.GetCellContainsValue("Reason", "Invalid number of contributors", "Reason"), "Invalid number of contributors"); //Double-click on exception queue record. //UICommon.DoubleClickElement(table.GetCellElementContainsValue("Reason", "Invalid Contributor : At least one contributor required", "Status Reason"), driver); table.ClickCellContainsValueEnterRow("Reason", "Invalid number of contributors", "Status Reason"); TenancyRequestQueueReasonPage tenancyRequestQueueReasonPage = new TenancyRequestQueueReasonPage(driver); //Click {Override} checkbox to select/tick it. tenancyRequestQueueReasonPage.SetOverrideCheckBox(true); //Click [SAVE & CLOSE] button. tenancyRequestQueueReasonPage.ClickSaveCloseButton(); tenancyRequestPage = new TenancyRequestPage(driver); //Set {Status Reason} to "Ready for validation". tenancyRequestPage.SetStatusReason("Ready for validation"); //Click [Save] button. tenancyRequestPage.ClickSaveButton(); string tenancyRequest = tenancyRequestPage.GetRequestNumber(); tenancyRequestPage.ClickSaveCloseButton(); tenancyRequestSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestSearchPage.SetTenancyRequestSearchText(tenancyRequest); table = new Table(tenancyRequestSearchPage.GetSearchResultTable()); table.GetCellValue("", "", ""); //Assert: {Status Reason} becomes "Validation successful". //StringAssert.Contains(tenancyRequestPage.GetStatusReason(), "Validation successful"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }
public void ATC6904c_CRMTopupExcessBondValidation() { #region Start Up Excel MyBook = MyApp.Workbooks.Open(DatasourceDir + @"\TenancyRequests.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() == "Topup_6904") { MyRow = i; break; } } #endregion string managepingParty = MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGING_PARTY")].Value.ToString(); //Login as RBS user User user = this.environment.GetUser(SecurityRole.RBSOfficer); new LoginDialog().Login(user.Id, user.Password); HomePage homePage = new HomePage(driver); homePage.HoverCRMRibbonTab(); homePage.ClickRBSRibbonButton(); homePage.HoverRBSRibbonTab(); homePage.ClickRtaTenancyRequestRibbonButton(); //(Template) - Create new Tenancy Request (Bond Lodgement) TenancyRequestsSearchPage tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); /*Enter details.Details entered - Tenancy (prepared Tenancy) - Rooming Accommodation - Rent subsidy - rent $200 - amount paId $701*/ tenancyRequestPage.SetRequestTypeListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("REQUEST_TYPE")].Value.ToString()); tenancyRequestPage.SetRentalPremisesValue("*"+MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("RENTAL_PREMISES")].Value.ToString()); tenancyRequestPage.SetManagingPartyListValue(managepingParty); tenancyRequestPage.SetTenancyTypeListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_TYPE")].Value.ToString()); tenancyRequestPage.SetTenancyManagementTypeListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("MANAGEMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetInitialRequestPartyWithSearch(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("INITIAL_REQUEST_PARTY")].Value.ToString()); tenancyRequestPage.SetInitialConrtibution("701"); tenancyRequestPage.SetAmountPaidWithLodgement("701"); tenancyRequestPage.SetLodgementTypeListValue("Top up"); tenancyRequestPage.SetWeeklyRent(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("WEEKLY_RENT")].Value.ToString()); tenancyRequestPage.SetTenancyStartDate(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("TENANCY_START")].Value.ToString()); tenancyRequestPage.SetAnticipatedEndDate(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("ANTICIPATED_END")].Value.ToString()); tenancyRequestPage.SetPaymentType(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("PAYMENT_TYPE")].Value.ToString()); tenancyRequestPage.SetDwellingTypeListValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("DWELLING_TYPE")].Value.ToString()); tenancyRequestPage.SetSubsidy("Yes"); tenancyRequestPage.SetTenancyValue(MyRange.Cells[MyRow, TenancyRequestSchema.GetColumnIndex("BOND_REF")].Value.ToString()); //Save Tenancy Request tenancyRequestPage.ClickSaveButton(); string tenancyrequest = tenancyRequestPage.GetRequestNumber(); //Update Status Reason to 'Ready for validation' tenancyRequestPage.SetStatusReason("Ready for validation"); tenancyRequestPage.ClickSaveCloseButton(); tenancyRequestsSearchPage = new TenancyRequestsSearchPage(driver); tenancyRequestsSearchPage.SetTenancyRequestSearchText(tenancyrequest); Table table = new Table(tenancyRequestsSearchPage.GetSearchResultTable()); table.ClickCellValue("Name", tenancyrequest, "Name"); tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Confirm Status Reason set to 'Validation failed' StringAssert.Contains(tenancyRequestPage.GetStatusReason(), "Validation failed"); //Confirm Queue reason for excess bond added.Status set to 'To be resolved' //tenancyRequestPage.ClickQueueReasons(); Table queueReasonTable = new Table(tenancyRequestPage.GetQueueReasonTable()); StringAssert.Contains(queueReasonTable.GetCellContainsValue("Reason", "Invalid bond amount : Exceeds maximum bond", "Status Reason"), "To be resolved"); //Confirm Maximum Allowed Bond set correctly //Assert: Maximum Allowed Bond set to $2800 Assert.AreEqual(tenancyRequestPage.GetMaximumAllowedAmount(), "$800.00"); }
public void ATC3367c_CRMSendemailfromCRMNewActivity() { #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()== "3367") { MyRow = i; break; } } #endregion string investigationID = MyRange.Cells[MyRow, InvestigationSchema.GetColumnIndex(ColumnName.IN_ID)].Value.ToString(); 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.ClickInvestigationsCasesRibbonButton(); InvestigationCaseSearchPage investigationsCaseSearchPage = new InvestigationCaseSearchPage(driver); investigationsCaseSearchPage.SetInvestigationSearchText(investigationID); Table table = new Table(investigationsCaseSearchPage.GetSearchResultTable()); table.ClickCellValue("Case Number", investigationID, "Case Number"); InvestigationCasePage investigationCasePage = new InvestigationCasePage(driver); StringAssert.Contains(investigationCasePage.GetInvestigationCaseNumber(), investigationID); table = new Table(investigationCasePage.GetActivitiesSearchResultTable()); StringAssert.Contains(table.GetCellContainsValue("Subject", "Test 3367 CRM Email Creation RTA:", "Activity Status"), "Completed"); #region Shut down Excel MyBook.Save(); MyBook.Close(); MyApp.Quit(); #endregion }