Skip to content

Commit

Permalink
tests: test hardening
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Mar 12, 2015
1 parent 2eca74a commit 82d1ab1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ private void openIgnoringHtmlUnitScriptErrors(final String url) {
}

private void setTimeouts() {
System.out.println("Set implicit wait to " + implicitTimeout);
webDriverFactory.setTimeouts(getProxiedDriver(), implicitTimeout);
// manage().timeouts().implicitlyWait(implicitTimeout.in(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
}

private boolean htmlunitScriptError(WebDriverException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import net.thucydides.core.webdriver.ThucydidesWebdriverManager
import net.thucydides.core.webdriver.exceptions.ElementShouldBeDisabledException
import net.thucydides.core.webdriver.exceptions.ElementShouldBeEnabledException
import net.thucydides.core.webdriver.exceptions.ElementShouldBeInvisibleException
import net.thucydides.core.webdriver.exceptions.ElementShouldBeVisibleException
import org.openqa.selenium.By
import org.openqa.selenium.NoSuchElementException
import spock.lang.Specification
Expand Down Expand Up @@ -91,7 +90,7 @@ class WhenManagingWebdriverTimeouts extends Specification {

def "If the implicit wait times out when fetching a list of values only the currently loaded values will be returned"() {
given: "We configure the WebDriver implicit wait to be 100 milliseconds"
environmentVariables.setProperty("webdriver.timeouts.implicitlywait","100")
environmentVariables.setProperty("webdriver.timeouts.implicitlywait","0")
when: "We access the a list of elements"
page = openTestPageUsing(defaultBrowser)
int itemCount = page.elementItems.size()
Expand Down
10 changes: 5 additions & 5 deletions core/src/test/resources/static-site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@

function displayFieldsAfterDelay() {
setTimeout("loadElementsSelect()", 2000);
setTimeout("displayCityField()", 1000);
setTimeout("displayCityField()", 2000);
setTimeout("displayCountryField()", 2000);
setTimeout("displaySlowLoaderField()", 4000);
setTimeout("hideLocationTitle()", 1000);
setTimeout("activateDisabledButton()", 1000);
setTimeout("deactivateEnabledButton()", 1000);
setTimeout("removeDisappearingText()", 1000);
setTimeout("hideLocationTitle()", 2000);
setTimeout("activateDisabledButton()", 2000);
setTimeout("deactivateEnabledButton()", 2000);
setTimeout("removeDisappearingText()", 2000);

}

Expand Down

0 comments on commit 82d1ab1

Please sign in to comment.