/// <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)); }
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"); }