public void InnerSCollectionSearchWaitsNothing() { Given.OpenedEmptyPage(); var elements = S("div").SS(".will-appear"); When.WithBody(@" <div> <ul>Hello to: <li class='will-appear'>Bob</li> <li class='will-appear' style='display:none'>Kate</li> </ul> </div>" ); When.WithBodyTimedOut(@" <div> <ul>Hello to: <li class='will-appear'>Bob</li> <li class='will-appear' style='display:none'>Kate</li> <li class='will-appear'>Bobik</li> </ul> </div>", 500 ); Assert.AreEqual(2, elements.Count); }
public void FilteredSCollectionSearchWaitsNothing() { Given.OpenedEmptyPage(); var elements = Selene.SS("li").FilterBy(Be.Visible); When.WithBodyTimedOut(@" <ul>Hello to: <li class='will-appear' style='display:none'>Miller</li> <li class='will-appear' style='display:none'>Julie Mao</li> </ul>" , 500 ); When.ExecuteScriptWithTimeout(@" document.getElementsByTagName('a')[1].style = 'display:block'; ", 1000 ); Assert.AreEqual(0, elements.Count); }
public void BothSCollectionAndIndexedSElementSearchWaitsForVisibilityOnActionsLikeClick() {// TODO: think on breaking down this test into two, or add one more explicitly testing implicit wait in get Given.OpenedEmptyPage(); When.WithBodyTimedOut(@" <a href='#first'>go to Heading 1</a> <a href='#second' style='display:none'>go to Heading 2</a> <h1 id='first'>Heading 1</h1> <h2 id='second'>Heading 2</h2>" , 250 ); Selene.ExecuteScript(@" setTimeout( function(){ document.getElementsByTagName('a')[1].style = 'display:block'; }, 500);" ); Selene.SS("a")[1].Click(); Assert.IsTrue(Selene.GetWebDriver().Url.Contains("second")); }
public void BothSCollectionAndFoundByConditionSElementSearchWaitsForVisibilityOnActionsLikeClick() { Given.OpenedEmptyPage(); When.WithBodyTimedOut(@" <a href='#first' style='display:none'>go to Heading 1</a> <a href='#second' style='display:none'>go to Heading 2</a> <h1 id='first'>Heading 1</h1> <h2 id='second'>Heading 2</h2>" , 250 ); Selene.ExecuteScript(@" setTimeout( function(){ document.getElementsByTagName('a')[1].style = 'display:block'; }, 500);" ); SS("a").FindBy(Be.Visible).Click(); Assert.IsTrue(Selene.Url().Contains("second")); }
public void IndexedSElementSearchWaitsForAppearanceOnActionsLikeClick() { Given.OpenedPageWithBody(@" <a href='#first'>go to Heading 1</a> <h1 id='first'>Heading 1</h1> <h2 id='second'>Heading 2</h2>" ); When.WithBodyTimedOut(@" <a href='#first'>go to Heading 1</a> <a href='#second' style='display:none'>go to Heading 2</a> <h1 id='first'>Heading 1</h1> <h2 id='second'>Heading 2</h2>" , 250 ); Selene.ExecuteScript(@" setTimeout( function(){ document.getElementsByTagName('a')[1].style = 'display:block'; }, 500);" ); Selene.SS("a")[1].Click(); Assert.IsTrue(Selene.GetWebDriver().Url.Contains("second")); }