This is an automated email from the ASF dual-hosted git repository.
jonnybot pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy-geb.git
The following commit(s) were added to refs/heads/master by this push:
new fc4130b3 Fix multi-window reporting trying to resolve 'backing' in the
SUT
fc4130b3 is described below
commit fc4130b3f190d9a98f4ba0bddad2d03fe64733b3
Author: Björn Kautler <[email protected]>
AuthorDate: Fri Apr 25 00:43:45 2025 +0200
Fix multi-window reporting trying to resolve 'backing' in the SUT
---
.../main/groovy/geb/report/MultiWindowReporter.groovy | 4 ++--
.../groovy/geb/report/MultiWindowReporterSpec.groovy | 16 +++++++++++++++-
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git
a/module/geb-core/src/main/groovy/geb/report/MultiWindowReporter.groovy
b/module/geb-core/src/main/groovy/geb/report/MultiWindowReporter.groovy
index 8c88f07f..6f78086f 100644
--- a/module/geb-core/src/main/groovy/geb/report/MultiWindowReporter.groovy
+++ b/module/geb-core/src/main/groovy/geb/report/MultiWindowReporter.groovy
@@ -44,9 +44,9 @@ class MultiWindowReporter implements Reporter {
void writeWindowReport(ReportState reportState, String windowId) {
reportState.browser.withWindow(windowId) {
- def windowLabel = "${reportState.label}-window $windowId"
+ def windowLabel = "${reportState.label}-window_$windowId"
def windowState = new ReportState(reportState.browser,
windowLabel, reportState.outputDir)
- backing.writeReport(windowState)
+ this.backing.writeReport(windowState)
}
}
diff --git
a/module/geb-core/src/test/groovy/geb/report/MultiWindowReporterSpec.groovy
b/module/geb-core/src/test/groovy/geb/report/MultiWindowReporterSpec.groovy
index d19cad68..eb67d411 100644
--- a/module/geb-core/src/test/groovy/geb/report/MultiWindowReporterSpec.groovy
+++ b/module/geb-core/src/test/groovy/geb/report/MultiWindowReporterSpec.groovy
@@ -45,7 +45,7 @@ class MultiWindowReporterSpec extends BaseWindowHandlingSpec {
report("test")
then:
- reportFileNames == availableWindows.collect { "001-001-writes report
for each open window-test-window ${it}.html" }.toSet()
+ reportFileNames == availableWindows.collect { "001-001-writes report
for each open window-test-window_${it}.html" }.toSet()
and:
linkTextsInReports == [
@@ -66,6 +66,20 @@ class MultiWindowReporterSpec extends BaseWindowHandlingSpec
{
reportFileNames == ["002-001-does not include window id in report name
if there is only a single window open-test.html"].toSet()
}
+ def "does not read backing from SUT but refers to its field"() {
+ given:
+ openAllWindows()
+ html {
+ input(type: "text", name: "backing")
+ }
+
+ when:
+ report("test")
+
+ then:
+ notThrown(MissingMethodException)
+ }
+
Set<List<String>> getLinkTextsInReports() {
groupDir.listFiles().collect {
def document = Jsoup.parse(it, StandardCharsets.UTF_8.toString())