From 6359ef25301f1cf73e75b78a74ddb0a3f2c9189a Mon Sep 17 00:00:00 2001 From: sandeepsuryaprasad Date: Tue, 15 Aug 2023 09:04:08 +0530 Subject: [PATCH 1/3] [py] added detailed docstring in _IeOptionsDescriptor class --- py/selenium/webdriver/ie/options.py | 52 ++++++++++++------- .../webdriver/remote/remote_connection.py | 4 +- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/py/selenium/webdriver/ie/options.py b/py/selenium/webdriver/ie/options.py index 3b0aea4569d7b..916be98a93266 100644 --- a/py/selenium/webdriver/ie/options.py +++ b/py/selenium/webdriver/ie/options.py @@ -26,25 +26,39 @@ class ElementScrollBehavior(Enum): class _IeOptionsDescriptor: - """IeOptionsDescriptor which validates below attributes of Options class: - - - BROWSER_ATTACH_TIMEOUT - - ELEMENT_SCROLL_BEHAVIOR - - ENSURE_CLEAN_SESSION - - FILE_UPLOAD_DIALOG_TIMEOUT - - FORCE_CREATE_PROCESS_API - - FORCE_SHELL_WINDOWS_API - - FULL_PAGE_SCREENSHOT - - IGNORE_PROTECTED_MODE_SETTINGS - - IGNORE_ZOOM_LEVEL - - INITIAL_BROWSER_URL - - NATIVE_EVENTS - - PERSISTENT_HOVER - - REQUIRE_WINDOW_FOCUS - - USE_PER_PROCESS_PROXY - - USE_LEGACY_FILE_UPLOAD_DIALOG_HANDLING - - ATTACH_TO_EDGE_CHROME - - EDGE_EXECUTABLE_PATH + """_IeOptionsDescriptor is an implementation of Descriptor Protocol: + + : Any look-up or assignment to the below attributes in `Options` class will be intercepted + by `__get__` and `__set__` method respectively. + + - `browser_attach_timeout` + - `element_scroll_behavior` + - `ensure_clean_session` + - `file_upload_dialog_timeout` + - `force_create_process_api` + - `force_shell_windows_api` + - `full_page_screenshot` + - `ignore_protected_mode_settings` + - `ignore_zoom_level` + - `initial_browser_url` + - `native_events` + - `persistent_hover` + - `require_window_focus` + - `use_per_process_proxy` + - `use_legacy_file_upload_dialog_handling` + - `attach_to_edge_chrome` + - `edge_executable_path` + + : when any assignment of lookup happens to the above mentioned attributes in `Options` class, + Example: + `self. browser_attach_timeout` + `__get__` method does a dictionary look up in the dictionary `_options` in `Options` class + and returns the value of key `browserAttachTimeout` + : When an attribute assignment happens, + Example: + `self.browser_attach_timeout` = 30 + `__set__` method sets/updates the value of the key `browserAttachTimeout` in `_options` + dictionary in `Options` class. """ def __init__(self, name, expected_type): diff --git a/py/selenium/webdriver/remote/remote_connection.py b/py/selenium/webdriver/remote/remote_connection.py index c5472ed621da5..2a4fec6768f33 100644 --- a/py/selenium/webdriver/remote/remote_connection.py +++ b/py/selenium/webdriver/remote/remote_connection.py @@ -162,8 +162,8 @@ def reset_timeout(cls): def get_certificate_bundle_path(cls): """ :Returns: - Paths of the .pem encoded certificate to verify connection to command executor. Defaults - to certifi.where() or REQUESTS_CA_BUNDLE env variable if set. + Paths of the .pem encoded certificate to verify connection to command executor. Defaults + to certifi.where() or REQUESTS_CA_BUNDLE env variable if set. """ return cls._ca_certs From ecf8a04bf0804e8f094c916c1f73e4565450b6d6 Mon Sep 17 00:00:00 2001 From: sandeepsuryaprasad Date: Tue, 15 Aug 2023 09:06:51 +0530 Subject: [PATCH 2/3] [py] added detailed docstring in _IeOptionsDescriptor class --- py/selenium/webdriver/ie/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/selenium/webdriver/ie/options.py b/py/selenium/webdriver/ie/options.py index 916be98a93266..7262f38eee20c 100644 --- a/py/selenium/webdriver/ie/options.py +++ b/py/selenium/webdriver/ie/options.py @@ -49,7 +49,7 @@ class _IeOptionsDescriptor: - `attach_to_edge_chrome` - `edge_executable_path` - : when any assignment of lookup happens to the above mentioned attributes in `Options` class, + : when any assignment or lookup happens to the above mentioned attributes in `Options` class, Example: `self. browser_attach_timeout` `__get__` method does a dictionary look up in the dictionary `_options` in `Options` class From fb80193da76958cb06949528a48421bc7ca49dc7 Mon Sep 17 00:00:00 2001 From: sandeepsuryaprasad Date: Tue, 15 Aug 2023 09:16:01 +0530 Subject: [PATCH 3/3] Added detailed docstring to _IeOptionsDescriptor class in ie/options.py --- py/selenium/webdriver/ie/options.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/selenium/webdriver/ie/options.py b/py/selenium/webdriver/ie/options.py index 7262f38eee20c..6fce1c0b3b623 100644 --- a/py/selenium/webdriver/ie/options.py +++ b/py/selenium/webdriver/ie/options.py @@ -49,7 +49,8 @@ class _IeOptionsDescriptor: - `attach_to_edge_chrome` - `edge_executable_path` - : when any assignment or lookup happens to the above mentioned attributes in `Options` class, + + : When an attribute lookup happens, Example: `self. browser_attach_timeout` `__get__` method does a dictionary look up in the dictionary `_options` in `Options` class