Skip to content

Commit 545cc9b

Browse files
committed
change return type in docstrings to List
1 parent 04f9e9f commit 545cc9b

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

java/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

java/test/org/openqa/selenium/remote/RemoteWebDriverUnitTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,4 +807,23 @@ 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 = new WebDriverFixture(
816+
new ImmutableCapabilities("se:downloadsEnabled", true),
817+
echoCapabilities,
818+
valueResponder(ImmutableMap.of("names", expectedFiles))
819+
);
820+
821+
List<String> result = fixture.driver.getDownloadableFiles();
822+
823+
assertThat(result)
824+
.isInstanceOf(List.class)
825+
.isEqualTo(expectedFiles);
826+
827+
fixture.verifyCommands(new CommandPayload(DriverCommand.GET_DOWNLOADABLE_FILES, emptyMap()));
828+
}
810829
}

0 commit comments

Comments
 (0)