Skip to content

Commit 1047de3

Browse files
authored
[py] Fix formatting issues in API reference (#12137)
1 parent d92b0ae commit 1047de3

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

py/docs/source/common/selenium.common.exceptions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
NoSuchShadowRootException
4646
NoSuchWindowException
4747
ScreenshotException
48+
SeleniumManagerException
4849
SessionNotCreatedException
4950
StaleElementReferenceException
5051
TimeoutException

py/selenium/webdriver/chromium/webdriver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def set_permissions(self, name: str, value: str) -> None:
112112
113113
:Usage:
114114
::
115+
115116
driver.set_permissions('clipboard-read', 'denied')
116117
"""
117118
self.execute("setPermissions", {"descriptor": {"name": name}, "state": value})
@@ -127,6 +128,7 @@ def execute_cdp_cmd(self, cmd: str, cmd_args: dict):
127128
- cmd_args: A dict, command args. empty dict {} if there is no command args
128129
:Usage:
129130
::
131+
130132
driver.execute_cdp_cmd('Network.getResponseBody', {'requestId': requestId})
131133
:Returns:
132134
A dict, empty dict {} if there is no result to return.

py/selenium/webdriver/common/alert.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ class Alert:
3232
Alert(driver).accept()
3333
Alert(driver).dismiss()
3434
35-
Inputting a value into an alert prompt:
35+
Inputting a value into an alert prompt::
3636
3737
name_prompt = Alert(driver)
3838
name_prompt.send_keys("Willian Shakesphere")
3939
name_prompt.accept()
4040
4141
42-
Reading a the text of a prompt for verification:
42+
Reading a the text of a prompt for verification::
4343
4444
alert_text = Alert(driver).text
4545
self.assertEqual("Do you wish to quit?", alert_text)
@@ -65,8 +65,10 @@ def dismiss(self):
6565
def accept(self):
6666
"""Accepts the alert available.
6767
68-
Usage::
69-
Alert(driver).accept() # Confirm a alert dialog.
68+
:Usage:
69+
::
70+
71+
Alert(driver).accept() # Confirm a alert dialog.
7072
"""
7173
self.driver.execute(Command.W3C_ACCEPT_ALERT)
7274

py/selenium/webdriver/remote/webdriver.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ def file_detector_context(self, file_detector_class, *args, **kwargs):
224224
"""Overrides the current file detector (if necessary) in limited
225225
context. Ensures the original file detector is set afterwards.
226226
227-
Example:
227+
Example::
228228
229-
with webdriver.file_detector_context(UselessFileDetector):
230-
someinput.send_keys('/etc/hosts')
229+
with webdriver.file_detector_context(UselessFileDetector):
230+
someinput.send_keys('/etc/hosts')
231231
232232
:Args:
233233
- file_detector_class - Class of the desired file detector. If the class is different
@@ -620,11 +620,13 @@ def add_cookie(self, cookie_dict) -> None:
620620
- cookie_dict: A dictionary object, with required keys - "name" and "value";
621621
optional keys - "path", "domain", "secure", "httpOnly", "expiry", "sameSite"
622622
623-
Usage:
624-
driver.add_cookie({'name' : 'foo', 'value' : 'bar'})
625-
driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'path' : '/'})
626-
driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'path' : '/', 'secure':True})
627-
driver.add_cookie({'name': 'foo', 'value': 'bar', 'sameSite': 'Strict'})
623+
:Usage:
624+
::
625+
626+
driver.add_cookie({'name' : 'foo', 'value' : 'bar'})
627+
driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'path' : '/'})
628+
driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'path' : '/', 'secure' : True})
629+
driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'sameSite' : 'Strict'})
628630
"""
629631
if "sameSite" in cookie_dict:
630632
assert cookie_dict["sameSite"] in ["Strict", "Lax", "None"]
@@ -686,6 +688,7 @@ def timeouts(self) -> Timeouts:
686688
687689
:Usage:
688690
::
691+
689692
driver.timeouts
690693
:rtype: Timeout
691694
"""

0 commit comments

Comments
 (0)