コード例 #1
0
        [Test] //Verifies if the correct number of homes is shown for the search with 6+ bedrooms filter option
        public void BedroomsFiltersResultsSix()
        {
            //1+ option selected
            HomesList homeList = new HomesList(_driver);
            var       homes    = homeList.GetHomes();
            var       filter   = homeList.OpenFilter();

            filter.SelectBedrooms(BedroomsCount.six);
            filter.ApplyFilter();
            var bedroomsFilteredSix = homeList.GetHomes();

            Assert.AreEqual(9, bedroomsFilteredSix.Count, $"Incorrect filtering result for 6+ bedrooms. " +
                            $"Should be 9, but was {bedroomsFilteredSix.Count}.");
        }
コード例 #2
0
        [Test] //The aim is to compare number of results before any filtering and after All bedrooms filter is applied

        public void BedroomsFiltersResultsAll()
        {
            //_driver.Navigate().GoToUrl("https://d1ykeet4wi4s9r.cloudfront.net/");
            HomesList homeList = new HomesList(_driver);
            var       homes    = homeList.GetHomes();
            var       filter   = homeList.OpenFilter();

            filter.SelectBedrooms(BedroomsCount.all);
            filter.ApplyFilter();
            var bedroomsFilteredAll = homeList.GetHomes();

            Assert.AreEqual(homes.Count, bedroomsFilteredAll.Count, $"Incorrect filtering result for All bedrooms. " +
                            $"Should be {homes.Count}, but was {bedroomsFilteredAll.Count}.");
        }
コード例 #3
0
        [Test] //Verifies if the correct number of homes is shown for the search with 1+ bedrooms filter option
        public void BedroomsFiltersResultsOne()
        {
            //1+ option selected
            HomesList homeList = new HomesList(_driver);
            var       homes    = homeList.GetHomes();
            var       filter   = homeList.OpenFilter();

            filter.SelectBedrooms(BedroomsCount.one);
            filter.ApplyFilter();
            var bedroomsFilteredOne = homeList.GetHomes();

            Assert.AreEqual(homes.Count, bedroomsFilteredOne.Count, $"Incorrect filtering result for 1+ bedrooms. " +
                            $"Should be {homes.Count}, but was {bedroomsFilteredOne.Count}.");
        }
コード例 #4
0
        [Test] //Verifies that only results matching search criteria are shown, 3+ bathrooms
        public void ThreeBathroomsResult()
        {
            //
            HomesList homeList = new HomesList(_driver);
            var       homes    = homeList.GetHomes();
            var       filter   = homeList.OpenFilter();

            filter.SelectBathrooms(BathroomsCount.three);
            filter.ApplyFilter();
            var bathroomsFilteredThree = homeList.GetHomes();

            foreach (var home in bathroomsFilteredThree)
            {
                Assert.True(home.Text.Contains("Bathrooms: 3"), "Result for 3+ bathrooms does not match search criteria.");
            }
        }