File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
java/test/org/openqa/selenium/testing Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 2222import java .net .MalformedURLException ;
2323import java .net .URL ;
2424import java .time .Duration ;
25+ import java .util .Arrays ;
2526import java .util .Optional ;
27+ import java .util .logging .Level ;
2628import java .util .logging .Logger ;
2729import org .junit .jupiter .api .AfterEach ;
2830import org .junit .jupiter .api .BeforeAll ;
@@ -43,6 +45,18 @@ public abstract class JupiterTestBase {
4345
4446 @ RegisterExtension protected static SeleniumExtension seleniumExtension = new SeleniumExtension ();
4547
48+ static {
49+ if ("true" .equalsIgnoreCase (System .getenv ("DEBUG" ))) {
50+ Logger rootLogger = Logger .getLogger ("" );
51+ rootLogger .setLevel (Level .FINE );
52+ Arrays .stream (rootLogger .getHandlers ()).forEach (handler -> {
53+ handler .setLevel (Level .FINE );
54+ });
55+
56+ LOG .fine ("Global debug logging enabled via DEBUG environment variable" );
57+ }
58+ }
59+
4660 protected TestEnvironment environment ;
4761 protected AppServer appServer ;
4862 protected Pages pages ;
@@ -81,9 +95,12 @@ public void prepareEnvironment() {
8195
8296 pages = new Pages (appServer );
8397
98+
99+
84100 driver = seleniumExtension .getDriver ();
85101 wait = seleniumExtension ::waitUntil ;
86102 shortWait = seleniumExtension ::shortWaitUntil ;
103+
87104 }
88105
89106 @ AfterEach
You can’t perform that action at this time.
0 commit comments