Skip to content

Commit c7a7de5

Browse files
committed
Refactor docstrings for clarity and conciseness across multiple files
1 parent 1f3c4f3 commit c7a7de5

File tree

8 files changed

+16
-24
lines changed

8 files changed

+16
-24
lines changed

py/selenium/webdriver/wpewebkit/options.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ def __init__(self) -> None:
2929

3030
@property
3131
def binary_location(self) -> str:
32-
"""Returns the location of the browser binary otherwise an empty
33-
string.
34-
"""
32+
"""Return the location of the browser binary or an empty string."""
3533
return self._binary_location
3634

3735
@binary_location.setter
@@ -45,10 +43,8 @@ def binary_location(self, value: str) -> None:
4543
raise TypeError(self.BINARY_LOCATION_ERROR)
4644
self._binary_location = value
4745

48-
def to_capabilities(self):
49-
"""Creates a capabilities with all the options that have been set and
50-
returns a dictionary with everything.
51-
"""
46+
def to_capabilities(self) -> dict:
47+
"""Create a capabilities dictionary with all set options."""
5248
caps = self._caps
5349

5450
browser_options = {}

py/selenium/webdriver/wpewebkit/service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525

2626

2727
class Service(service.Service):
28-
"""A Service class that is responsible for the starting and stopping of
29-
`WPEWebDriver`.
28+
"""A Service class that is responsible for the starting and stopping of `WPEWebDriver`.
3029
3130
Args:
3231
executable_path: Install path of the WPEWebDriver executable, defaults

py/selenium/webdriver/wpewebkit/webdriver.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ def __init__(
4949
self._is_remote = False
5050

5151
def quit(self):
52-
"""Closes the browser and shuts down the WPEWebKitDriver executable
53-
that is started when starting the WPEWebKitDriver.
54-
"""
52+
"""Close the browser and shut down the WPEWebKit driver executable."""
5553
try:
5654
super().quit()
5755
except http_client.BadStatusLine:

py/test/selenium/webdriver/common/interactions_tests.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,7 @@ def test_sending_keys_to_element(driver, pages):
209209

210210

211211
def test_can_send_keys_between_clicks(driver, pages):
212-
"""For W3C, ensures that the correct number of pauses are given to the other
213-
input device.
214-
"""
212+
"""Ensure W3C sends correct pause count to other input devices."""
215213
pages.load("javascriptPage.html")
216214
keyup = driver.find_element(By.ID, "keyUp")
217215
keydown = driver.find_element(By.ID, "keyDown")

py/test/selenium/webdriver/common/interactions_with_device_tests.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ def test_sending_keys_to_element_with_keyboard(driver, pages):
194194

195195

196196
def test_can_send_keys_between_clicks_with_keyboard(driver, pages):
197-
"""For W3C, ensures that the correct number of pauses are given to the other
198-
input device.
199-
"""
197+
"""Ensure W3C sends correct pause count to other input devices."""
200198
pages.load("javascriptPage.html")
201199
keyup = driver.find_element(By.ID, "keyUp")
202200
keydown = driver.find_element(By.ID, "keyDown")

py/test/selenium/webdriver/common/page_loader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
"""This module contains some decorators that can be used to support
19-
the page models. For example for an action that needs a page to be fully
20-
loaded, the @require_loaded decorator will make sure the page is loaded
21-
before the call is invoked.
18+
"""This module contains some decorators that can be used to support the page models.
19+
20+
For example for an action that needs a page to be fully loaded, the @require_loaded
21+
decorator will make sure the page is loaded before the call is invoked.
2222
This pattern is also useful for waiting for certain asynchronous events
2323
to happen before executing certain actions.
2424
"""

py/test/selenium/webdriver/common/webdriverwait_tests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,10 @@ def test_expected_condition_attribute_to_be_include_in_element(driver, pages):
364364

365365

366366
def test_driver_with_http_timeout(driver, pages):
367-
"""This test starts a webdriver with an http client timeout set less than the implicit
368-
wait, and verifies the http timeout is triggered first when waiting for an element.
367+
"""This test starts a webdriver with an http client timeout.
368+
369+
It verifies the http timeout is triggered first when waiting for an element,
370+
with the timeout set less than the implicit wait.
369371
"""
370372
pages.load("simpleTest.html")
371373
driver.command_executor.client_config.timeout = 6

py/test/selenium/webdriver/common/webserver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
"""A simple web server for testing purpose.
19+
1920
It serves the testing html pages that are needed by the webdriver unit tests.
2021
"""
2122

0 commit comments

Comments
 (0)