Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow to configure implicit wait #147

Open
wants to merge 3 commits into
base: 4.2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ By default, no test recording will be performed. Here are the system properties
* possible values are `FLV` or `MP4`
* defaults to `MP4`

#### Remove Implicit Wait

* `grails.geb.implicitWait`
* purpose: test-containers edge case
* defaults to `30` (seconds)


#### Observability and Tracing
Selenium integrates with [OpenTelemetry](https://opentelemetry.io) to support observability and tracing out of the box. By default, Selenium [enables tracing](https://www.selenium.dev/blog/2021/selenium-4-observability).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class GrailsGebSettings {
VncRecordingMode recordingMode
VncRecordingFormat recordingFormat
LocalDateTime startTime
Integer implicitWait

GrailsGebSettings(LocalDateTime startTime) {
tracingEnabled = System.getProperty('grails.geb.tracing.enabled', 'false')
Expand All @@ -55,6 +56,11 @@ class GrailsGebSettings {
recordingFormat = VncRecordingFormat.valueOf(
System.getProperty('grails.geb.recording.format', DEFAULT_RECORDING_FORMAT.name())
)
try {
implicitWait = Integer.parseInt(System.getProperty('grails.geb.implicitWait', '30'))
} catch (NumberFormatException ignored) {
implicitWait = 30
}
this.startTime = startTime
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ class WebDriverContainerHolder {
currentBrowser = new Browser(new Configuration(configObject, new Properties(), null, null))

WebDriver driver = new RemoteWebDriver(currentContainer.seleniumAddress, new ChromeOptions())
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30))
if (grailsGebSettings.implicitWait > 0) {
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30))
}

currentBrowser.driver = driver

Expand Down
Loading