Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaugherty committed Nov 28, 2024
1 parent a5e0137 commit 9b238a4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ abstract class ContainerGebSpec extends Specification implements ContainerAwareD
}

/**
* The reporter that GebShould use when reporting is enabled.
* The reporter that Geb should use when reporting is enabled.
*/
Reporter createReporter() {
new CompositeReporter(new PageSourceReporter())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ class GebRecordingTestListener extends AbstractRunListener {

WebDriverContainerHolder containerHolder
ErrorInfo errorInfo
SpecInfo spec
LocalDateTime runDate

GebRecordingTestListener(WebDriverContainerHolder containerHolder, SpecInfo spec) {
this.spec = spec
this.runDate = runDate
GebRecordingTestListener(WebDriverContainerHolder containerHolder) {
this.containerHolder = containerHolder
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ class GrailsContainerGebExtension implements IGlobalExtension {
addGebExtensionOnFailureReporter(spec)

GebRecordingTestListener recordingListener = new GebRecordingTestListener(
holder,
spec
holder
)
spec.addListener(recordingListener)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class WebDriverContainerHolder {

ConfigObject configObject = new ConfigObject()
if (currentConfiguration.reporting) {
configObject.reportsDir = grailsGebSettings.getReportingDirectory()
configObject.reportsDir = grailsGebSettings.reportingDirectory
configObject.reporter = (invocation.sharedInstance as ContainerGebSpec).createReporter()
}

Expand All @@ -132,7 +132,7 @@ class WebDriverContainerHolder {
// real url cannot be set (it will be checked as part of the geb test manager startup in reporting mode)
// set the url to localhost, which the selenium server should respond to (albeit with an error that will be ignored)

currentBrowser.baseUrl = "http://localhost"
currentBrowser.baseUrl = 'http://localhost'

testManager = createTestManager()

Expand Down Expand Up @@ -167,13 +167,13 @@ class WebDriverContainerHolder {

private static String getHostIp() {
try {
PortForwardingContainer.getDeclaredMethod("getNetwork").with {
PortForwardingContainer.getDeclaredMethod('getNetwork').with {
accessible = true
Optional<ContainerNetwork> network = invoke(PortForwardingContainer.INSTANCE) as Optional<ContainerNetwork>
return network.get().ipAddress
}
} catch (Exception e) {
throw new RuntimeException("Could not access network from PortForwardingContainer", e)
throw new RuntimeException('Could not access network from PortForwardingContainer', e)
}
}

Expand Down

0 comments on commit 9b238a4

Please sign in to comment.