public static Page <T> ToPage <T>(this MSPage msPage) { if (msPage.Error != null) { throw msPage.Error.ToDataException(); } return(new Page <T> { Items = msPage.Items .Select(i => i.ToDocumentWrapper <T>()).ToList() }); }
public void OpenArticle_SectionsLinkTextsAreSameAsSectionsNames() { //Arrange MSPage mainPage = PageFactory.Get <MSPage>(); ArticlePage articlePage = PageFactory.Get <ArticlePage>(); mainPage.Load(); mainPage.OpenIntroductionToNetAndDockerArticle(); //Act foreach (IWebElement navigation in articlePage.ArticleNavigations) { string navigationHref = navigation.GetAttribute("href"); string sectionID = navigationHref.Substring(navigationHref.IndexOf('#') + 1); navigation.FindAndClick(); IWebElement section = articlePage.ElementWith(sectionID); //Assert Assert.IsTrue(section.Text == navigation.Text); Assert.IsTrue(section.Displayed); } }