Ejemplo n.º 1
0
        public void ThenThePropertyDetailsInformationIsTheSameAsIAdded()
        {
            // Creates a toggle for the given test, adds all log events under it
            test = extent.CreateTest("Add New Property --  Validate property details of search result under Properties Page");

            PropertyDetailsPage propertyDetails = new PropertyDetailsPage();
            int tenantNum     = propertyDetails.GetTenantNumber();
            int newrequestNun = propertyDetails.GetNewRequestNumber();
            int maintanceNum  = propertyDetails.GetMaintanceNumber();
            int paymentNum    = propertyDetails.GetPaymentNumber();

            // Populating the data from Excel
            ExcelLib.PopulateInCollection(Base.ExcelPath, "Property Details");
            String ExpectBedroomNum  = ExcelLib.ReadData(2, "Bedrooms");
            String ExpectBathroomNum = ExcelLib.ReadData(2, "Bathrooms");
            String ExpectCarparkNum  = ExcelLib.ReadData(2, "Carparks");

            string ActualBedroomNum  = propertyDetails.GetBedroomNumber();
            string ActualBathroomNum = propertyDetails.GetBathroomNumber();
            string ActualCarparkNum  = propertyDetails.GetCarparkNumber();

            if (tenantNum == 1 & newrequestNun == 0 & maintanceNum == 0 & paymentNum == 0 & ActualBedroomNum.Equals(ExpectBedroomNum) & ActualBathroomNum.Equals(ExpectBathroomNum) & ActualCarparkNum.Equals(ExpectCarparkNum))
            {
                Base.test.Log(AventStack.ExtentReports.Status.Pass, "Test passed, The property details information is the same as I added");
            }
            else
            {
                Base.test.Log(AventStack.ExtentReports.Status.Fail, "Test failed, The property details information is not the same as I added");
            }
        }
Ejemplo n.º 2
0
        public void NavigateThroughPropertiesTest()
        {
            this.driver.Url = "https://grup5web.firebaseapp.com/property-details/property-details.html?id=9";

            var page = new PropertyDetailsPage(this.driver);

            int initialPropertyId = page.GetPropertyId();

            Debug.WriteLine("Initial Property " + initialPropertyId);

            // Navigate to the first Property
            while (page.CanGoToPreviousProperty())
            {
                page.GoToPreviousProperty();
            }

            int firstPropertyId = page.GetPropertyId();

            Debug.WriteLine("First Property " + firstPropertyId);
            Assert.AreNotEqual(initialPropertyId, firstPropertyId);

            // Navigate to last property (the one we were in the beginning)
            while (page.CanGoToNextProperty())
            {
                page.GoToNextProperty();
            }

            int lastPropertyId = page.GetPropertyId();

            Debug.WriteLine("Last Property " + lastPropertyId);
            Assert.AreEqual(initialPropertyId, lastPropertyId);
        }