You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I wish to create some unit tests to TDD my page objects, and I use the following static website pattern:
@DefaultUrl("classpath:static-site/error-modal-on-search/my-application.html")
public class SearchResultsErrorModalPage extends PageObject {
}
and then reference this as follows:
@Managed(driver = "htmlunit")
WebDriver browser;
Actor actor = new Actor("MDM");
actor.can(BrowseTheWeb.with(browser));
SearchResultsErrorModalPage searchResultsErrorModalPage;
givenThat(actor).attemptsTo(Open.browserOn().the(searchResultsErrorModalPage));
I find that when I run @Test cases individually, they work fine but when I run the whole test class or run all tests in the suite some fail. The nature of failure is that the website I expect to be there is not being rendered properly. Is there a different way to scope/instantiate the page object correctly/reliably?
The text was updated successfully, but these errors were encountered:
hmm, no it actually fails on all browsers. Error is org.openqa.selenium.NoSuchElementException: Returned node was not a DOM element, Say 1 out of 4 tests fail - oddly enough it's the last one each time!
I see this sometimes when I run all tests in net.serenitybdd.screenplay.webtests directory in the serenity-screenplay-webdriver project which also use the static html site pattern.
nbarrett
changed the title
Serenity Unit tests fail when run in suite
Serenity Unit tests fail when using @DefaultUrl("classpath:static-site...)
Jan 12, 2017
nbarrett
changed the title
Serenity Unit tests fail when using @DefaultUrl("classpath:static-site...)
Serenity Unit tests fail when using @DefaultUrl("classpath:<static-site.html>")
Jan 12, 2017
If I wish to create some unit tests to TDD my page objects, and I use the following static website pattern:
and then reference this as follows:
I find that when I run
@Test
cases individually, they work fine but when I run the whole test class or run all tests in the suite some fail. The nature of failure is that the website I expect to be there is not being rendered properly. Is there a different way to scope/instantiate the page object correctly/reliably?The text was updated successfully, but these errors were encountered: