File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
java/src/org/openqa/selenium Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,23 @@ public interface HasDownloads {
33
33
* @throws WebDriverException if capability to enable downloads is not set
34
34
*/
35
35
default void requireDownloadsEnabled (Capabilities capabilities ) {
36
- boolean downloadsEnabled = capabilities .is ("se:downloadsEnabled" );
37
- if (!downloadsEnabled ) {
36
+ if (!isDownloadsEnabled (capabilities )) {
38
37
throw new WebDriverException (
39
38
"You must enable downloads in order to work with downloadable files." );
40
39
}
41
40
}
42
41
42
+ /**
43
+ * Checks if downloads are enabled
44
+ *
45
+ * @return true if this webdriver has capability "se:downloadsEnabled" = true
46
+ */
47
+ boolean isDownloadsEnabled ();
48
+
49
+ static boolean isDownloadsEnabled (Capabilities capabilities ) {
50
+ return capabilities .is ("se:downloadsEnabled" );
51
+ }
52
+
43
53
/**
44
54
* Gets the downloadable files.
45
55
*
Original file line number Diff line number Diff line change @@ -649,6 +649,11 @@ public void removeVirtualAuthenticator(VirtualAuthenticator authenticator) {
649
649
Map .of ("authenticatorId" , authenticator .getId ()));
650
650
}
651
651
652
+ @ Override
653
+ public boolean isDownloadsEnabled () {
654
+ return HasDownloads .isDownloadsEnabled (capabilities );
655
+ }
656
+
652
657
/**
653
658
* Retrieves the names of the downloadable files.
654
659
*
You can’t perform that action at this time.
0 commit comments