public void PO_SearchTenantAfterAddingNewTenant() { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("Search the tenant after adding new tenant for a given property"); test.AssignCategory("Add New Tenant"); #region Delete the existing tenant of the given proeprty //Before adding new tenant, check whether the tenant already exist, if exist ,delete it ExcelLib.PopulateInCollection(Base.ExcelPath, "Add Tenant"); String propertyName = ExcelLib.ReadData(2, "Property Name"); String tenantEmail = ExcelLib.ReadData(2, "Tenant Email"); //go to my properties page from dashboard DashboardPage dashBoard = new DashboardPage(); dashBoard.GoToMyPropertiesPage(); //search the given property MyPropertiesPage myProperty = new MyPropertiesPage(); myProperty.SearchAPropertySuccessfully(propertyName); //go to manage tenant page and delete the tenant which user want to add myProperty.GoToManageTenantPage(); ManageTenantPage manageTenant = new ManageTenantPage(); manageTenant.RemoveTenant(tenantEmail); //go back to my properties page and then go to add tenant page manageTenant.GoBackToProperties(); myProperty.AddTenant(); #endregion #region Add new tenant //Fill out the add tenant details form and go to liability details form AddTenantPage addTenant = new AddTenantPage(); addTenant.AddTenantDetails(); addTenant.NextToLiabilityDetails(); //Add a new liability and go to sumamry form addTenant.ClickAddNewLiability(); addTenant.AddLiabilityDetails(); addTenant.SaveNewLiability(); addTenant.NextToSummary(); //Save the new tenant addTenant.Submit(); #endregion //Search the given property under my properties page myProperty.SearchAPropertySuccessfully(propertyName); //Go to manage tenant page myProperty.GoToManageTenantPage(); if (manageTenant.FindATenant(tenantEmail)) { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test passed, successfully find the new tenant under manage tenant page"); } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test failed, fail to find the new tenant under manage tenant page"); } }
public void PO_SearchPropertyAfterAddingNewProperty() { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("Search property after adding a new property"); test.AssignCategory("New Add Property"); //Go to my properties page DashboardPage dashboard = new DashboardPage(); dashboard.GoToMyPropertiesPage(); //Get new property name from the excel file ExcelLib.PopulateInCollection(Base.ExcelPath, "Property Details"); String PropertyName = ExcelLib.ReadData(2, "Property Name"); //Search this property under my properties page and delete the property which has the same name as new property MyPropertiesPage myProperty = new MyPropertiesPage(); if (myProperty.SearchAPropertySuccessfully(PropertyName)) { myProperty.DeleteAProperty(PropertyName); } //Click add new property button and go to add new property page myProperty.AddNewProperty(); #region Add new property AddNewPropertyPage addNewProperty = new AddNewPropertyPage(); //Fill out property details form and go to finance details form addNewProperty.AddPropertyDetails(); addNewProperty.GotoFinanceForm(); //Fill out finance details form and go to tenant details form addNewProperty.AddFinanceDetails(); addNewProperty.GotoTenantForm(); //Fill out tenant details page and save new property addNewProperty.AddTenantDetails(); addNewProperty.SaveProperty(); #endregion //Do the validation if (myProperty.SearchAPropertySuccessfully(PropertyName)) { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test passed, successfully search this new added property"); } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test falied, fail to search this new added property"); } }
public void GivenIMAlreadyUnderTheAddTenantPageOfAGivenProeprty() { ExcelLib.PopulateInCollection(Base.ExcelPath, "Add Tenant"); String propertyName = ExcelLib.ReadData(2, "Property Name"); String tenantEmail = ExcelLib.ReadData(2, "Tenant Email"); //go to my properties page from dashboard DashboardPage dashBoard = new DashboardPage(); dashBoard.GoToMyPropertiesPage(); //search a property MyPropertiesPage myProperty = new MyPropertiesPage(); myProperty.SearchAPropertySuccessfully(propertyName); //go to manage tenant page and delete the tenant which user want to add myProperty.GoToManageTenantPage(); ManageTenantPage manageTenant = new ManageTenantPage(); manageTenant.RemoveTenant(tenantEmail); //go back to my properties page and then go to add tenant page manageTenant.GoBackToProperties(); myProperty.AddTenant(); }
public void WhenISearchThisPropertyInThePropertyList() { ExcelLib.PopulateInCollection(Base.ExcelPath, "Add Tenant"); String propertyName = ExcelLib.ReadData(2, "Property Name"); MyPropertiesPage myProperty = new MyPropertiesPage(); myProperty.SearchAPropertySuccessfully(propertyName); }
public void GivenISearchThisPropertyUnderPropertiesPage() { // Got the search data from excel ExcelLib.PopulateInCollection(Base.ExcelPath, "Property Details"); String searchPropertyName = ExcelLib.ReadData(2, "Property Name"); MyPropertiesPage propertyOwner = new MyPropertiesPage(); propertyOwner.SearchAPropertySuccessfully(searchPropertyName); }
public void GivenIMAlreadyUnderTheSendRequestPageOfAGivenProperty() { ExcelLib.PopulateInCollection(Base.ExcelPath, "Send Request"); String propertyName = ExcelLib.ReadData(2, "Property Name"); //go to my properties page from dashboard DashboardPage dashBoard = new DashboardPage(); dashBoard.GoToMyPropertiesPage(); //search a property MyPropertiesPage myProperty = new MyPropertiesPage(); myProperty.SearchAPropertySuccessfully(propertyName); // go to send request page myProperty.SendRequest(); }
public void ThenTheSearchResultForThisPropertyIsCorrect() { // Got the search data from excel ExcelLib.PopulateInCollection(Base.ExcelPath, "Property Details"); String searchPropertyName = ExcelLib.ReadData(2, "Property Name"); // Creates a toggle for the given test, adds all log events under it test = extent.CreateTest("Search for a Property"); MyPropertiesPage propertyOwner = new MyPropertiesPage(); //Assert.AreEqual(ExpectedValue, ActualValue); if (propertyOwner.SearchAPropertySuccessfully(searchPropertyName)) { Base.test.Log(AventStack.ExtentReports.Status.Pass, "Test Passed, Search successfull"); } else { Base.test.Log(AventStack.ExtentReports.Status.Fail, "Test Failed, Search Unsuccessfull"); } }
public void PO_SendRequest() { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("Send a request and login as tenant check this request"); test.AssignCategory("Send Request"); //go to my properties page from dashboard DashboardPage dashBoard = new DashboardPage(); dashBoard.GoToMyPropertiesPage(); //Get the data from excel file ExcelLib.PopulateInCollection(Base.ExcelPath, "Send Request"); String propertyName = ExcelLib.ReadData(2, "Property Name"); //search this property MyPropertiesPage myProperty = new MyPropertiesPage(); myProperty.SearchAPropertySuccessfully(propertyName); //Click send request button and go to send request page myProperty.SendRequest(); //Fill out the send request form and save SendRequestPage sendRequest = new SendRequestPage(); sendRequest.AddRequstInformation(); sendRequest.SaveRequest(); //Logout from owner account DashboardPage dashboard = new DashboardPage(); dashboard.SignOut(); //Login as tenant LoginPage login = new LoginPage(); login.LoginSuccessfull(3); //Go to Landlord's Request page TenantDashboardPage tenantDashboard = new TenantDashboardPage(); tenantDashboard.GoToLandlordRequestPage(); LandlordRequestPage landlordRequest = new LandlordRequestPage(); string ActualLandlord = landlordRequest.GetCurrentRequestLandlord(); string ActualType = landlordRequest.GetCurrentRequestType(); string ActualMessage = landlordRequest.GetCurrentRequestMessage(); ExcelLib.PopulateInCollection(Base.ExcelPath, "Send Request"); string ExpectType = ExcelLib.ReadData(2, "Type"); string ExpectMessage = ExcelLib.ReadData(2, "Description"); ExcelLib.PopulateInCollection(Base.ExcelPath, "LoginPage"); String ExpectLandlord = ExcelLib.ReadData(2, "Owner Name"); if (ActualLandlord.Equals(ExpectLandlord) & ActualType.Equals(ExpectType) & ActualMessage.Equals(ExpectMessage)) { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test passed, successfully send a request to tenant"); } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test failed, fail to send a request to tenant"); } }