Skip to content

Commit f8240df

Browse files
[py] minor ie-options fix to PR 12283 (#12309)
* ie options fix to PR 12283 * [py] minor ie-options fix to PR 12283
1 parent 50f9252 commit f8240df

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

py/selenium/webdriver/ie/options.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,11 @@ def __set__(self, obj, value) -> None:
5858
if not isinstance(value, self.expected_type):
5959
raise ValueError(f"{self.name} should be of type {self.expected_type.__name__}")
6060

61-
if self.name == "ELEMENT_SCROLL_BEHAVIOR" and value not in [
61+
if self.name == "elementScrollBehavior" and value not in [
6262
ElementScrollBehavior.TOP.value,
6363
ElementScrollBehavior.BOTTOM.value,
6464
]:
6565
raise ValueError("Element Scroll Behavior out of range.")
66-
6766
obj._options[self.name] = value
6867

6968

@@ -91,7 +90,7 @@ class Options(ArgOptions):
9190
IGNORE_PROCESS_MATCH = "ie.ignoreprocessmatch"
9291

9392
# Creating descriptor objects for each of the above IE options
94-
browser_attach_timeout = _IeOptionsDescriptor("BROWSER_ATTACH_TIMEOUT", int)
93+
browser_attach_timeout = _IeOptionsDescriptor(BROWSER_ATTACH_TIMEOUT, int)
9594
"""Gets and Sets `browser_attach_timeout`
9695
9796
Usage
@@ -106,7 +105,7 @@ class Options(ArgOptions):
106105
`value`: `int` (Timeout) in milliseconds
107106
"""
108107

109-
element_scroll_behavior = _IeOptionsDescriptor("ELEMENT_SCROLL_BEHAVIOR", int)
108+
element_scroll_behavior = _IeOptionsDescriptor(ELEMENT_SCROLL_BEHAVIOR, int)
110109
"""Gets and Sets `element_scroll_behavior`
111110
112111
Usage
@@ -121,7 +120,7 @@ class Options(ArgOptions):
121120
`value`: `int` either 0 - Top, 1 - Bottom
122121
"""
123122

124-
ensure_clean_session = _IeOptionsDescriptor("ENSURE_CLEAN_SESSION", bool)
123+
ensure_clean_session = _IeOptionsDescriptor(ENSURE_CLEAN_SESSION, bool)
125124
"""Gets and Sets `ensure_clean_session`
126125
127126
Usage
@@ -136,7 +135,7 @@ class Options(ArgOptions):
136135
`value`: `bool`
137136
"""
138137

139-
file_upload_dialog_timeout = _IeOptionsDescriptor("FILE_UPLOAD_DIALOG_TIMEOUT", int)
138+
file_upload_dialog_timeout = _IeOptionsDescriptor(FILE_UPLOAD_DIALOG_TIMEOUT, int)
140139
"""Gets and Sets `file_upload_dialog_timeout`
141140
142141
Usage
@@ -151,7 +150,7 @@ class Options(ArgOptions):
151150
`value`: `int` (Timeout) in milliseconds
152151
"""
153152

154-
force_create_process_api = _IeOptionsDescriptor("FORCE_CREATE_PROCESS_API", bool)
153+
force_create_process_api = _IeOptionsDescriptor(FORCE_CREATE_PROCESS_API, bool)
155154
"""Gets and Sets `force_create_process_api`
156155
157156
Usage
@@ -166,7 +165,7 @@ class Options(ArgOptions):
166165
`value`: `bool`
167166
"""
168167

169-
force_shell_windows_api = _IeOptionsDescriptor("FORCE_SHELL_WINDOWS_API", bool)
168+
force_shell_windows_api = _IeOptionsDescriptor(FORCE_SHELL_WINDOWS_API, bool)
170169
"""Gets and Sets `force_shell_windows_api`
171170
172171
Usage
@@ -181,7 +180,7 @@ class Options(ArgOptions):
181180
`value`: `bool`
182181
"""
183182

184-
full_page_screenshot = _IeOptionsDescriptor("FULL_PAGE_SCREENSHOT", bool)
183+
full_page_screenshot = _IeOptionsDescriptor(FULL_PAGE_SCREENSHOT, bool)
185184
"""Gets and Sets `full_page_screenshot`
186185
187186
Usage
@@ -196,7 +195,7 @@ class Options(ArgOptions):
196195
`value`: `bool`
197196
"""
198197

199-
ignore_protected_mode_settings = _IeOptionsDescriptor("IGNORE_PROTECTED_MODE_SETTINGS", bool)
198+
ignore_protected_mode_settings = _IeOptionsDescriptor(IGNORE_PROTECTED_MODE_SETTINGS, bool)
200199
"""Gets and Sets `ignore_protected_mode_settings`
201200
202201
Usage
@@ -211,7 +210,7 @@ class Options(ArgOptions):
211210
`value`: `bool`
212211
"""
213212

214-
ignore_zoom_level = _IeOptionsDescriptor("IGNORE_ZOOM_LEVEL", bool)
213+
ignore_zoom_level = _IeOptionsDescriptor(IGNORE_ZOOM_LEVEL, bool)
215214
"""Gets and Sets `ignore_zoom_level`
216215
217216
Usage
@@ -226,7 +225,7 @@ class Options(ArgOptions):
226225
`value`: `bool`
227226
"""
228227

229-
initial_browser_url = _IeOptionsDescriptor("INITIAL_BROWSER_URL", str)
228+
initial_browser_url = _IeOptionsDescriptor(INITIAL_BROWSER_URL, str)
230229
"""Gets and Sets `initial_browser_url`
231230
232231
Usage
@@ -241,7 +240,7 @@ class Options(ArgOptions):
241240
`value`: `str`
242241
"""
243242

244-
native_events = _IeOptionsDescriptor("NATIVE_EVENTS", bool)
243+
native_events = _IeOptionsDescriptor(NATIVE_EVENTS, bool)
245244
"""Gets and Sets `native_events`
246245
247246
Usage
@@ -256,7 +255,7 @@ class Options(ArgOptions):
256255
`value`: `bool`
257256
"""
258257

259-
persistent_hover = _IeOptionsDescriptor("PERSISTENT_HOVER", bool)
258+
persistent_hover = _IeOptionsDescriptor(PERSISTENT_HOVER, bool)
260259
"""Gets and Sets `persistent_hover`
261260
262261
Usage
@@ -271,7 +270,7 @@ class Options(ArgOptions):
271270
`value`: `bool`
272271
"""
273272

274-
require_window_focus = _IeOptionsDescriptor("REQUIRE_WINDOW_FOCUS", bool)
273+
require_window_focus = _IeOptionsDescriptor(REQUIRE_WINDOW_FOCUS, bool)
275274
"""Gets and Sets `require_window_focus`
276275
277276
Usage
@@ -286,7 +285,7 @@ class Options(ArgOptions):
286285
`value`: `bool`
287286
"""
288287

289-
use_per_process_proxy = _IeOptionsDescriptor("USE_PER_PROCESS_PROXY", bool)
288+
use_per_process_proxy = _IeOptionsDescriptor(USE_PER_PROCESS_PROXY, bool)
290289
"""Gets and Sets `use_per_process_proxy`
291290
292291
Usage
@@ -301,7 +300,7 @@ class Options(ArgOptions):
301300
`value`: `bool`
302301
"""
303302

304-
use_legacy_file_upload_dialog_handling = _IeOptionsDescriptor("USE_LEGACY_FILE_UPLOAD_DIALOG_HANDLING", bool)
303+
use_legacy_file_upload_dialog_handling = _IeOptionsDescriptor(USE_LEGACY_FILE_UPLOAD_DIALOG_HANDLING, bool)
305304
"""Gets and Sets `use_legacy_file_upload_dialog_handling`
306305
307306
Usage
@@ -316,7 +315,7 @@ class Options(ArgOptions):
316315
`value`: `bool`
317316
"""
318317

319-
attach_to_edge_chrome = _IeOptionsDescriptor("ATTACH_TO_EDGE_CHROME", bool)
318+
attach_to_edge_chrome = _IeOptionsDescriptor(ATTACH_TO_EDGE_CHROME, bool)
320319
"""Gets and Sets `attach_to_edge_chrome`
321320
322321
Usage
@@ -331,7 +330,7 @@ class Options(ArgOptions):
331330
`value`: `bool`
332331
"""
333332

334-
edge_executable_path = _IeOptionsDescriptor("EDGE_EXECUTABLE_PATH", str)
333+
edge_executable_path = _IeOptionsDescriptor(EDGE_EXECUTABLE_PATH, str)
335334
"""Gets and Sets `edge_executable_path`
336335
337336
Usage
@@ -387,4 +386,4 @@ def to_capabilities(self) -> dict:
387386

388387
@property
389388
def default_capabilities(self) -> dict:
390-
return DesiredCapabilities.INTERNETEXPLORER.copy()
389+
return DesiredCapabilities.INTERNETEXPLORER.copy()

0 commit comments

Comments
 (0)