2727import static org .testingisdocumenting .webtau .cfg .ConfigValue .declareBoolean ;
2828
2929public class BrowserConfig implements WebTauConfigHandler {
30- private static final Supplier <Object > NO_DEFAULT = () -> null ;
30+ private static final Supplier <Object > NULL_DEFAULT = () -> null ;
3131
3232 private static final ConfigValue windowWidth = declare ("windowWidth" , "browser window width" , () -> 1000 );
3333 private static final ConfigValue windowHeight = declare ("windowHeight" , "browser window height" , () -> 800 );
3434 private static final ConfigValue headless = declareBoolean ("headless" , "run headless mode" );
3535
3636 private static final ConfigValue browser = declare ("browser" , "browser name: chrome, firefox" , () -> "chrome" );
3737
38- private static final ConfigValue chromeBinPath = declare ("chromeBinPath" , "path to chrome binary" , NO_DEFAULT );
39- private static final ConfigValue chromeDriverPath = declare ("chromeDriverPath" , "path to chrome driver binary" , NO_DEFAULT );
38+ private static final ConfigValue disableExtensions = declare ("disableExtensions" , "run without extensions" , () -> false );
4039
41- private static final ConfigValue firefoxBinPath = declare ("firefoxBinPath" , "path to firefox binary" , NO_DEFAULT );
42- private static final ConfigValue firefoxDriverPath = declare ("firefoxDriverPath" , "path to firefox driver binary" , NO_DEFAULT );
40+ private static final ConfigValue chromeBinPath = declare ("chromeBinPath" , "path to chrome binary" , NULL_DEFAULT );
41+ private static final ConfigValue chromeDriverPath = declare ("chromeDriverPath" , "path to chrome driver binary" , NULL_DEFAULT );
42+
43+ private static final ConfigValue firefoxBinPath = declare ("firefoxBinPath" , "path to firefox binary" , NULL_DEFAULT );
44+ private static final ConfigValue firefoxDriverPath = declare ("firefoxDriverPath" , "path to firefox driver binary" , NULL_DEFAULT );
4345
4446 public static String getBrowser () {
4547 return browser .getAsString ();
@@ -57,6 +59,10 @@ public static boolean isHeadless() {
5759 return headless .getAsBoolean ();
5860 }
5961
62+ public static boolean areExtensionsDisabled () {
63+ return disableExtensions .getAsBoolean ();
64+ }
65+
6066 public static void setHeadless (boolean isHeadless ) {
6167 headless .set ("manual" , isHeadless );
6268 }
@@ -84,6 +90,7 @@ public Stream<ConfigValue> additionalConfigValues() {
8490 windowWidth ,
8591 windowHeight ,
8692 headless ,
93+ disableExtensions ,
8794 chromeDriverPath ,
8895 chromeBinPath ,
8996 firefoxDriverPath ,
0 commit comments