示例#1
0
        /// <summary>
        /// A method to search hotels
        /// </summary>
        /// <param name="testdata"></param>
        /// <returns>Whether search results appear or not</returns>
        public bool SearchHotels(HotelsTdo testdata)
        {
            BrowserContext.ClickElement(_hotelLink);
            BrowserContext.WaitFor(1000);
            BrowserContext.SendText(_localityTextBox, testdata.Locality);
            var localities = BrowserContext.GetWebElement(ElementIdentifierType.Id, LocalityUlId)
                             .FindElements(By.TagName(ListTag));

            BrowserContext.ClickElement(localities[1]);
            BrowserContext.SelectElementFromDropDown(_travellerSelection, SelectBy.Text, testdata.TravellerSelection);
            BrowserContext.ClickElement(_searchButton);

            return(BrowserContext.IsElementPresent(ElementIdentifierType.ClassName, SearchSummaryClass));
        }
示例#2
0
        public void ShouldBeAbleToSearchForHotels()
        {
            //Arrange
            var testdata = new HotelsTdo {
                Locality           = "Indiranagar, Bangalore",
                TravellerSelection = "1 room, 2 adults"
            };

            var hotelsView = new HotelsView(BrowserContext.CurrentDriver);

            //Act
            bool actual = hotelsView.SearchHotels(testdata);

            //Assert
            Assert.True(actual, "Search Result not found");
        }