Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit b27b2df

Browse files
slu-itDrakojin
authored andcommitted
Amended JUnit 5 support module documentation with note about multi-browser usage of @ConfigurationValue
1 parent b89664d commit b27b2df

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

webtester-documentation/src/main/asciidoc/chapters/support-module-junit5.asciidoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,33 @@ public class ExampleUiTest {
244244
245245
}
246246
----
247+
248+
In case you are declaring _multiple_ `Browser` fields, the `source` of the
249+
configuration properties must be declared. This is necessary because each browser
250+
might have a different configuration and the extension cannot decide which is the
251+
'correct' one.
252+
253+
[source, java]
254+
----
255+
@EnableWebTesterExtensions
256+
@CreateBrowsersUsing(FooFactory.class)
257+
public class ExampleUiTest {
258+
259+
@Managed("browser-1")
260+
Browser browser1;
261+
262+
@Managed("browser-2")
263+
Browser browser2;
264+
265+
@ConfigurationValue(value = "stringValue", source = "browser-1")
266+
String stringValueOfBrowser1;
267+
268+
@ConfigurationValue(value = "stringValue", source = "browser-2")
269+
String stringValueOfBrowser2;
270+
271+
...
272+
273+
}
274+
----
275+
276+

0 commit comments

Comments
 (0)