Ejemplo n.º 1
0
            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 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);
        }
Ejemplo n.º 4
0
        public void GivenIMAlreadyOnTheAddNewPropertyPage()
        {
            DashboardPage dashBoard = new DashboardPage();

            dashBoard.GoToMyPropertiesPage();
            MyPropertiesPage myProperties = new MyPropertiesPage();

            myProperties.AddNewProperty();
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
            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");
                }
            }
Ejemplo n.º 7
0
        public void ThenIMNavigatedToMyPropertiesPage()
        {
            test = extent.CreateTest("List A Rental -- Deal with confirmation dialog and confirm to cancel");

            MyPropertiesPage obj = new MyPropertiesPage();

            if (obj.IsAddNewPropertyButtonDisplayed())
            {
                Base.test.Log(AventStack.ExtentReports.Status.Pass, "Test passed, successfully navigate to my properties page after confirm cancel");
            }
            else
            {
                Base.test.Log(AventStack.ExtentReports.Status.Fail, "Test falied, fail to navigate to my properties page after confirm cancel");
            }
        }
        public void ThenIMNavigatedToMyPropertiesPageFromAddTenantPage()
        {
            test = extent.CreateTest("Add Tenant -- Submit all the information under summary section");
            test.AssignCategory("Add Tenant Testing");

            MyPropertiesPage propertyOwner = new MyPropertiesPage();

            if (propertyOwner.IsMyPropertiesPageHeaderVisible())
            {
                Base.test.Log(AventStack.ExtentReports.Status.Pass, "Test passed, successfully navigated to my properties page from Add Tenant Page");
            }
            else
            {
                Base.test.Log(AventStack.ExtentReports.Status.Fail, "Test falied, fail navigated to my properties page from Add Tenant Page");
            }
        }
Ejemplo n.º 9
0
        public void ThenIAmNavigatedToMyPropertiesPageFromSendRequestPage()
        {
            test = extent.CreateTest("Send Request -- Send a request to tenant");
            test.AssignCategory("Add Tenant Testing");

            MyPropertiesPage propertyOwner = new MyPropertiesPage();

            if (propertyOwner.IsMyPropertiesPageHeaderVisible())
            {
                Base.test.Log(AventStack.ExtentReports.Status.Pass, "Test passed, successfully navigated to My Properties page from Send Request Page");
            }
            else
            {
                Base.test.Log(AventStack.ExtentReports.Status.Fail, "Test falied, fail navigated to My Properties page from Send Request Page");
            }
        }
Ejemplo n.º 10
0
        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();
        }
Ejemplo n.º 11
0
            public void PO_SearchPropertyAfterListingRental()
            {
                // Creates a toggle for the given test, adds all log events under it
                test = extent.StartTest("Search the property after listing as rental");
                test.AssignCategory("List A Rental");

                //Go to my properties page
                DashboardPage dashboard = new DashboardPage();

                dashboard.GoToMyPropertiesPage();

                //Click list rental button and go to add list rental proeprty page
                MyPropertiesPage myProperty = new MyPropertiesPage();

                myProperty.ListARental();

                //Fill out the list rental property form and save
                ListRentalPropertyPage listrentalProerty = new ListRentalPropertyPage();

                listrentalProerty.AddRentalPropertyDetails();
                listrentalProerty.SaveListRentalProperty();
                //handle the alert and click ok
                Driver.driver.SwitchTo().Alert().Accept();

                //Go to the properties for rent page
                dashboard.GotoPropertiesForRentPage();

                // Got the property title from excel
                ExcelLib.PopulateInCollection(Base.ExcelPath, "List Rental Property");
                String searchPropertyTitle = ExcelLib.ReadData(2, "Title");

                PropertiesForRentPage propertyForRent = new PropertiesForRentPage();

                if (propertyForRent.SearchRentalPropertySuccessfully(searchPropertyTitle))
                {
                    test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test passed, successfully search this property after listing as a rental");
                }
                else
                {
                    test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test failed, fail to search this property after listing as a reantal");
                }
            }
Ejemplo n.º 12
0
        public void ThenNewPropertyIsAddedSuccessfullyAndIMNavigatedToThePropertyOwnerPage()
        {
            try
            {
                test = extent.CreateTest("Add New Property -- fill out tenant details form and save all information");
                MyPropertiesPage propertyOwner = new MyPropertiesPage();

                if (propertyOwner.IsAddNewPropertyButtonDisplayed())
                {
                    Base.test.Log(AventStack.ExtentReports.Status.Pass, "Test passed, save all the information successfull");
                }
                else
                {
                    Base.test.Log(AventStack.ExtentReports.Status.Fail, "Test falied, save all the information unsuccessfull");
                }
            }
            catch (Exception e)
            {
                Base.test.Log(AventStack.ExtentReports.Status.Fail, "Test failed, sace all the information unsuccessfull");
            }
        }
Ejemplo n.º 13
0
        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");
            }
        }
Ejemplo n.º 14
0
            public void PO_ListAsRental()
            {
                // Creates a toggle for the given test, adds all log events under it
                test = extent.StartTest("List a property as rental");
                test.AssignCategory("List A Rental");

                //Go to my properties page
                DashboardPage dashboard = new DashboardPage();

                dashboard.GoToMyPropertiesPage();

                //Click list rental button and go to add list rental proeprty page
                MyPropertiesPage myProperty = new MyPropertiesPage();

                myProperty.ListARental();

                //Fill out the list rental property form and save
                ListRentalPropertyPage listrentalProerty = new ListRentalPropertyPage();

                listrentalProerty.AddRentalPropertyDetails();
                listrentalProerty.SaveListRentalProperty();

                //handle the alert and click ok
                Driver.driver.SwitchTo().Alert().Accept();

                RentalListingsAndTenantApplications rentalApplication = new RentalListingsAndTenantApplications();

                if (rentalApplication.IsHeaderDisplayed())
                {
                    test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test passed, successfully navigate to rental listings&applications page after listing a rental");
                }
                else
                {
                    test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test failed, fail to navigate to rental listings&applications page after listing a rental");
                }
            }
Ejemplo n.º 15
0
            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");
                }
            }
        public void WhenIClickManageTenantButtonAndGoToManageTenantPage()
        {
            MyPropertiesPage myProperty = new MyPropertiesPage();

            myProperty.GoToManageTenantPage();
        }
Ejemplo n.º 17
0
        public void WhenIClickTheFirstSearchingResult()
        {
            MyPropertiesPage myProperty = new MyPropertiesPage();

            myProperty.ClickFirstPorpertyNameInList();
        }
Ejemplo n.º 18
0
        public void GivenIMAlreadyOnTheListRentalPropertyPage()
        {
            MyPropertiesPage myProperty = new MyPropertiesPage();

            myProperty.ListARental();
        }