Ejemplo n.º 1
0
            public void PO_AddNewTenant()
            {
                // Creates a toggle for the given test, adds all log events under it
                test = extent.StartTest("Add a new tenant for a property");
                test.AssignCategory("Add New Tenant");

                #region Delete the existing tenant
                //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 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();

                #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

                if (myProperty.IsMyPropertiesPageHeaderVisible())
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test passed, successfully navigated to my properties page after adding a new tenant for a given property");
                }
                else
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test falied, fail to navigated to my properties page after adding a new tenant for a given property");
                }
            }
Ejemplo n.º 2
0
            public void PO_AddNewProperty()
            {
                // Creates a toggle for the given test, adds all log events under it
                test = extent.StartTest("Add 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
                //Fill out property details form and go to finance details form
                AddNewPropertyPage addNewProperty = new AddNewPropertyPage();
                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.IsMyPropertiesPageHeaderVisible())
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test passed, successfully navigated to my properties page after adding a new property");
                }
                else
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test falied, fail to navigated to my properties page after adding a new property");
                }
            }
Ejemplo n.º 3
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");
            }
        }
        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");
            }
        }