public void ATC5512_CRMRaiseExceptionForLodgementExceedingBond() { #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() == "5512") { 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); //Click [+NEW] button. tenancyRequestSearchPage.ClickNewTenancyRequestButton(); TenancyRequestPage tenancyRequestPage = new TenancyRequestPage(driver); tenancyRequestPage.ClickPageTitle(); //Set {Type} field to Bond Lodgement. tenancyRequestPage.SetRequestTypeListValue("Bond Lodgement"); //Enter details 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(); StringAssert.Contains(tenancyRequestPage.GetValidationStatusReason(), "Validation successful"); //Confirm Queue reason for excess bond not added tenancyRequestPage.ClickQueueReasons(); Table table = new Table(tenancyRequestPage.GetQueueReasonTable()); Assert.IsTrue(table.GetNoRecordsInTable()); //Confirm Maximum Allowed Bond set correctly //Assert: Maximum Allowed Bond set to $400 StringAssert.Contains(tenancyRequestPage.GetMaximumAllowedAmount(), "400"); #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 }