private void AssertSearchResult(IHtmlDivElement searchResults) { var tLevelProvider = searchResults.QuerySelector("#tl-provider"); tLevelProvider.TextContent.Should().Be("T level provider"); tLevelProvider.ClassName.Should().Be("tl-search-results-flag"); var venueDetailList = searchResults.QuerySelector("#tl-venue-detail-list"); var providerNameListItem = venueDetailList.Children[0] as IHtmlListItemElement; providerNameListItem.TextContent.Should().Be("Part of SQL Search Provider Display Name"); var townAndPostcodeListItem = venueDetailList.Children[1] as IHtmlListItemElement; townAndPostcodeListItem.TextContent.Should().Be("Coventry CV1 2WT"); var journeyInfo = searchResults.QuerySelector("#tl-journey-info"); journeyInfo.Children.Length.Should().Be(1); var distanceItem = journeyInfo.Children[0] as IHtmlParagraphElement; distanceItem.TextContent.Should().Be("0.0 miles"); var qualificationList = searchResults.QuerySelector("#tl-qualification-list") as IHtmlUnorderedListElement; var routeName1 = qualificationList.Children[0] as IHtmlListItemElement; routeName1.QuerySelector("details > summary > span").TextContent.Should().Be("Agriculture, environmental and animal care"); var shortTitleList = routeName1.QuerySelector("details > div > ul") as IHtmlUnorderedListElement; var shortTitle1 = shortTitleList.Children[0] as IHtmlListItemElement; shortTitle1.TextContent.Should().Be("Short Title"); }
private static (string trackName, string trackPath) FindTrackInfo(IHtmlDivElement parent) { var trackAnchor = parent.QuerySelector <IHtmlAnchorElement>("div.item-info div.item-title a"); if (trackAnchor != null) { return(trackAnchor.Text.Trim(), trackAnchor.PathName); } var trackOverlayInfo = parent.QuerySelector <IHtmlDivElement>("div.item-info div.item-title"); return(trackOverlayInfo.TextContent.Trim(), $"/track/{parent.Dataset["id"]}"); }