File tree 2 files changed +19
-2
lines changed
src/org/openqa/selenium/remote
test/org/openqa/selenium/remote 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -651,9 +651,9 @@ public void removeVirtualAuthenticator(VirtualAuthenticator authenticator) {
651
651
}
652
652
653
653
/**
654
- * Retrieves the downloadable files as a map of file names and their corresponding URLs .
654
+ * Retrieves the names of the downloadable files .
655
655
*
656
- * @return A map containing file names as keys and URLs as values .
656
+ * @return A list containing the names of the downloadable files .
657
657
* @throws WebDriverException if capability to enable downloads is not set
658
658
*/
659
659
@ Override
Original file line number Diff line number Diff line change @@ -807,4 +807,21 @@ void noArgConstructorEmptyCapabilitiesTest() {
807
807
RemoteWebDriver driver = new RemoteWebDriver () {}; // anonymous subclass
808
808
assertThat (driver .getCapabilities ()).isEqualTo (new ImmutableCapabilities ());
809
809
}
810
+
811
+ @ Test
812
+ void getDownloadableFilesReturnsType () {
813
+ List <String > expectedFiles = Arrays .asList ("file1.txt" , "file2.pdf" );
814
+
815
+ WebDriverFixture fixture =
816
+ new WebDriverFixture (
817
+ new ImmutableCapabilities ("se:downloadsEnabled" , true ),
818
+ echoCapabilities ,
819
+ valueResponder (ImmutableMap .of ("names" , expectedFiles )));
820
+
821
+ List <String > result = fixture .driver .getDownloadableFiles ();
822
+
823
+ assertThat (result ).isInstanceOf (List .class ).isEqualTo (expectedFiles );
824
+
825
+ fixture .verifyCommands (new CommandPayload (DriverCommand .GET_DOWNLOADABLE_FILES , emptyMap ()));
826
+ }
810
827
}
You can’t perform that action at this time.
0 commit comments