File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
src/org/openqa/selenium/remote
test/org/openqa/selenium/remote Expand file tree Collapse file tree 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) {
651651 }
652652
653653 /**
654- * Retrieves the downloadable files as a map of file names and their corresponding URLs .
654+ * Retrieves the names of the downloadable files .
655655 *
656- * @return A map containing file names as keys and URLs as values .
656+ * @return A list containing the names of the downloadable files .
657657 * @throws WebDriverException if capability to enable downloads is not set
658658 */
659659 @ Override
Original file line number Diff line number Diff line change @@ -807,4 +807,21 @@ void noArgConstructorEmptyCapabilitiesTest() {
807807 RemoteWebDriver driver = new RemoteWebDriver () {}; // anonymous subclass
808808 assertThat (driver .getCapabilities ()).isEqualTo (new ImmutableCapabilities ());
809809 }
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+ }
810827}
You can’t perform that action at this time.
0 commit comments