Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[py] minor ie-options fix to PR 12283 #12309

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions py/selenium/webdriver/ie/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ def __set__(self, obj, value) -> None:
if not isinstance(value, self.expected_type):
raise ValueError(f"{self.name} should be of type {self.expected_type.__name__}")

if self.name == "ELEMENT_SCROLL_BEHAVIOR" and value not in [
if self.name == "elementScrollBehavior" and value not in [
ElementScrollBehavior.TOP.value,
ElementScrollBehavior.BOTTOM.value,
]:
raise ValueError("Element Scroll Behavior out of range.")

obj._options[self.name] = value


Expand Down Expand Up @@ -91,7 +90,7 @@ class Options(ArgOptions):
IGNORE_PROCESS_MATCH = "ie.ignoreprocessmatch"

# Creating descriptor objects for each of the above IE options
browser_attach_timeout = _IeOptionsDescriptor("BROWSER_ATTACH_TIMEOUT", int)
browser_attach_timeout = _IeOptionsDescriptor(BROWSER_ATTACH_TIMEOUT, int)
"""Gets and Sets `browser_attach_timeout`

Usage
Expand All @@ -106,7 +105,7 @@ class Options(ArgOptions):
`value`: `int` (Timeout) in milliseconds
"""

element_scroll_behavior = _IeOptionsDescriptor("ELEMENT_SCROLL_BEHAVIOR", int)
element_scroll_behavior = _IeOptionsDescriptor(ELEMENT_SCROLL_BEHAVIOR, int)
"""Gets and Sets `element_scroll_behavior`

Usage
Expand All @@ -121,7 +120,7 @@ class Options(ArgOptions):
`value`: `int` either 0 - Top, 1 - Bottom
"""

ensure_clean_session = _IeOptionsDescriptor("ENSURE_CLEAN_SESSION", bool)
ensure_clean_session = _IeOptionsDescriptor(ENSURE_CLEAN_SESSION, bool)
"""Gets and Sets `ensure_clean_session`

Usage
Expand All @@ -136,7 +135,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

file_upload_dialog_timeout = _IeOptionsDescriptor("FILE_UPLOAD_DIALOG_TIMEOUT", int)
file_upload_dialog_timeout = _IeOptionsDescriptor(FILE_UPLOAD_DIALOG_TIMEOUT, int)
"""Gets and Sets `file_upload_dialog_timeout`

Usage
Expand All @@ -151,7 +150,7 @@ class Options(ArgOptions):
`value`: `int` (Timeout) in milliseconds
"""

force_create_process_api = _IeOptionsDescriptor("FORCE_CREATE_PROCESS_API", bool)
force_create_process_api = _IeOptionsDescriptor(FORCE_CREATE_PROCESS_API, bool)
"""Gets and Sets `force_create_process_api`

Usage
Expand All @@ -166,7 +165,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

force_shell_windows_api = _IeOptionsDescriptor("FORCE_SHELL_WINDOWS_API", bool)
force_shell_windows_api = _IeOptionsDescriptor(FORCE_SHELL_WINDOWS_API, bool)
"""Gets and Sets `force_shell_windows_api`

Usage
Expand All @@ -181,7 +180,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

full_page_screenshot = _IeOptionsDescriptor("FULL_PAGE_SCREENSHOT", bool)
full_page_screenshot = _IeOptionsDescriptor(FULL_PAGE_SCREENSHOT, bool)
"""Gets and Sets `full_page_screenshot`

Usage
Expand All @@ -196,7 +195,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

ignore_protected_mode_settings = _IeOptionsDescriptor("IGNORE_PROTECTED_MODE_SETTINGS", bool)
ignore_protected_mode_settings = _IeOptionsDescriptor(IGNORE_PROTECTED_MODE_SETTINGS, bool)
"""Gets and Sets `ignore_protected_mode_settings`

Usage
Expand All @@ -211,7 +210,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

ignore_zoom_level = _IeOptionsDescriptor("IGNORE_ZOOM_LEVEL", bool)
ignore_zoom_level = _IeOptionsDescriptor(IGNORE_ZOOM_LEVEL, bool)
"""Gets and Sets `ignore_zoom_level`

Usage
Expand All @@ -226,7 +225,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

initial_browser_url = _IeOptionsDescriptor("INITIAL_BROWSER_URL", str)
initial_browser_url = _IeOptionsDescriptor(INITIAL_BROWSER_URL, str)
"""Gets and Sets `initial_browser_url`

Usage
Expand All @@ -241,7 +240,7 @@ class Options(ArgOptions):
`value`: `str`
"""

native_events = _IeOptionsDescriptor("NATIVE_EVENTS", bool)
native_events = _IeOptionsDescriptor(NATIVE_EVENTS, bool)
"""Gets and Sets `native_events`

Usage
Expand All @@ -256,7 +255,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

persistent_hover = _IeOptionsDescriptor("PERSISTENT_HOVER", bool)
persistent_hover = _IeOptionsDescriptor(PERSISTENT_HOVER, bool)
"""Gets and Sets `persistent_hover`

Usage
Expand All @@ -271,7 +270,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

require_window_focus = _IeOptionsDescriptor("REQUIRE_WINDOW_FOCUS", bool)
require_window_focus = _IeOptionsDescriptor(REQUIRE_WINDOW_FOCUS, bool)
"""Gets and Sets `require_window_focus`

Usage
Expand All @@ -286,7 +285,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

use_per_process_proxy = _IeOptionsDescriptor("USE_PER_PROCESS_PROXY", bool)
use_per_process_proxy = _IeOptionsDescriptor(USE_PER_PROCESS_PROXY, bool)
"""Gets and Sets `use_per_process_proxy`

Usage
Expand All @@ -301,7 +300,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

use_legacy_file_upload_dialog_handling = _IeOptionsDescriptor("USE_LEGACY_FILE_UPLOAD_DIALOG_HANDLING", bool)
use_legacy_file_upload_dialog_handling = _IeOptionsDescriptor(USE_LEGACY_FILE_UPLOAD_DIALOG_HANDLING, bool)
"""Gets and Sets `use_legacy_file_upload_dialog_handling`

Usage
Expand All @@ -316,7 +315,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

attach_to_edge_chrome = _IeOptionsDescriptor("ATTACH_TO_EDGE_CHROME", bool)
attach_to_edge_chrome = _IeOptionsDescriptor(ATTACH_TO_EDGE_CHROME, bool)
"""Gets and Sets `attach_to_edge_chrome`

Usage
Expand All @@ -331,7 +330,7 @@ class Options(ArgOptions):
`value`: `bool`
"""

edge_executable_path = _IeOptionsDescriptor("EDGE_EXECUTABLE_PATH", str)
edge_executable_path = _IeOptionsDescriptor(EDGE_EXECUTABLE_PATH, str)
"""Gets and Sets `edge_executable_path`

Usage
Expand Down Expand Up @@ -387,4 +386,4 @@ def to_capabilities(self) -> dict:

@property
def default_capabilities(self) -> dict:
return DesiredCapabilities.INTERNETEXPLORER.copy()
return DesiredCapabilities.INTERNETEXPLORER.copy()