Ejemplo n.º 1
0
 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()
     });
 }
Ejemplo n.º 2
0
        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);
            }
        }