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 {
3333 * @throws WebDriverException if capability to enable downloads is not set
3434 */
3535 default void requireDownloadsEnabled (Capabilities capabilities ) {
36- boolean downloadsEnabled = capabilities .is ("se:downloadsEnabled" );
37- if (!downloadsEnabled ) {
36+ if (!isDownloadsEnabled (capabilities )) {
3837 throw new WebDriverException (
3938 "You must enable downloads in order to work with downloadable files." );
4039 }
4140 }
4241
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+
4353 /**
4454 * Gets the downloadable files.
4555 *
Original file line number Diff line number Diff line change @@ -649,6 +649,11 @@ public void removeVirtualAuthenticator(VirtualAuthenticator authenticator) {
649649 Map .of ("authenticatorId" , authenticator .getId ()));
650650 }
651651
652+ @ Override
653+ public boolean isDownloadsEnabled () {
654+ return HasDownloads .isDownloadsEnabled (capabilities );
655+ }
656+
652657 /**
653658 * Retrieves the names of the downloadable files.
654659 *
You can’t perform that action at this time.
0 commit comments