Example #1
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");
                }
            }
Example #2
0
        public void WhenIGoToLandlordSRequestPage()
        {
            TenantDashboardPage dashboard = new TenantDashboardPage();

            dashboard.GoToLandlordRequestPage();
        }