Promium 3.6.3__tar.gz → 3.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {promium-3.6.3 → promium-3.6.4}/PKG-INFO +1 -1
- {promium-3.6.3 → promium-3.6.4}/Promium.egg-info/PKG-INFO +1 -1
- {promium-3.6.3 → promium-3.6.4}/promium/browsers.py +14 -19
- {promium-3.6.3 → promium-3.6.4}/promium/plugin.py +6 -1
- {promium-3.6.3 → promium-3.6.4}/promium/test_case.py +4 -1
- {promium-3.6.3 → promium-3.6.4}/setup.py +1 -1
- {promium-3.6.3 → promium-3.6.4}/LICENSE +0 -0
- {promium-3.6.3 → promium-3.6.4}/Promium.egg-info/SOURCES.txt +0 -0
- {promium-3.6.3 → promium-3.6.4}/Promium.egg-info/dependency_links.txt +0 -0
- {promium-3.6.3 → promium-3.6.4}/Promium.egg-info/entry_points.txt +0 -0
- {promium-3.6.3 → promium-3.6.4}/Promium.egg-info/requires.txt +0 -0
- {promium-3.6.3 → promium-3.6.4}/Promium.egg-info/top_level.txt +0 -0
- {promium-3.6.3 → promium-3.6.4}/README.rst +0 -0
- {promium-3.6.3 → promium-3.6.4}/doc/__init__.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/doc/conf.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/__init__.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/assertions.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/base.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/common.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/device_config.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/__init__.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/checkbox.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/drop_downs.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/frame.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/input_field.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/link.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/multiselect_listbox.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/radio_button.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/textarea_field.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/elements/upload_button.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/exceptions.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/expected_conditions.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/helpers.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/logger.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/support/__init__.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/support/settings.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/promium/waits.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/setup.cfg +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/__init__.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/config.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/conftest.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/pages/__init__.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/pages/catalog_404_page.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/pages/catalog_gallery_page.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/settings/__init__.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/settings/test_base.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/settings/test_chrome.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/settings/test_edge.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/settings/test_firefox.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/settings/test_ie.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/settings/test_opera.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/test_catalog_404.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/test_catalog_gallery.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/test_enviroment.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/test_requests.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/test_soft_asserts.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/test_waits.py +0 -0
- {promium-3.6.3 → promium-3.6.4}/tests/urls.py +0 -0
|
@@ -42,21 +42,6 @@ def get_chrome_opera_options(
|
|
|
42
42
|
options.add_argument("--ignore-certificate-errors")
|
|
43
43
|
options.add_argument("--disable-notifications")
|
|
44
44
|
options.add_argument("--dns-prefetch-disable")
|
|
45
|
-
options.add_argument("--proxy-bypass-list=*ws*;*chat*")
|
|
46
|
-
prefs = {
|
|
47
|
-
"download.default_directory": DOWNLOAD_PATH,
|
|
48
|
-
"download.directory_upgrade": True,
|
|
49
|
-
'prompt_for_download': False,
|
|
50
|
-
"profile.default_content_setting_values.cookies": 1,
|
|
51
|
-
"profile.block_third_party_cookies": True
|
|
52
|
-
}
|
|
53
|
-
options.add_experimental_option("prefs", prefs)
|
|
54
|
-
options.add_experimental_option("excludeSwitches", [
|
|
55
|
-
"enable-automation", # disable the automation bar
|
|
56
|
-
])
|
|
57
|
-
# fix use window.onbeforeunload
|
|
58
|
-
options.enable_bidi = True
|
|
59
|
-
options.unhandled_prompt_behavior = 'ignore'
|
|
60
45
|
|
|
61
46
|
if device.__class__.__name__ == "CustomDevice":
|
|
62
47
|
mobile_emulation = {
|
|
@@ -79,8 +64,10 @@ def get_chrome_opera_options(
|
|
|
79
64
|
return options
|
|
80
65
|
|
|
81
66
|
|
|
82
|
-
def get_chrome_options(
|
|
83
|
-
|
|
67
|
+
def get_chrome_options(
|
|
68
|
+
device, proxy_server=None, is_headless=False, default_options=None
|
|
69
|
+
):
|
|
70
|
+
options = default_options if default_options else ChromeOptions()
|
|
84
71
|
return get_chrome_opera_options(options, device, proxy_server, is_headless)
|
|
85
72
|
|
|
86
73
|
|
|
@@ -202,7 +189,15 @@ class RemoteBrowser(webdriver.Remote):
|
|
|
202
189
|
|
|
203
190
|
class ChromeBrowser(webdriver.Chrome):
|
|
204
191
|
|
|
205
|
-
def __init__(
|
|
192
|
+
def __init__(
|
|
193
|
+
self,
|
|
194
|
+
*args,
|
|
195
|
+
device,
|
|
196
|
+
proxy_server,
|
|
197
|
+
is_headless,
|
|
198
|
+
browser_options=None,
|
|
199
|
+
**kwargs,
|
|
200
|
+
):
|
|
206
201
|
"""
|
|
207
202
|
Initialise a new Chrome WebDriver instance.
|
|
208
203
|
"""
|
|
@@ -220,7 +215,7 @@ class ChromeBrowser(webdriver.Chrome):
|
|
|
220
215
|
capabilities.update(proxy_capabilities.to_capabilities())
|
|
221
216
|
|
|
222
217
|
options = get_chrome_options(
|
|
223
|
-
device, proxy_server, is_headless
|
|
218
|
+
device, proxy_server, is_headless, browser_options,
|
|
224
219
|
)
|
|
225
220
|
if is_headless:
|
|
226
221
|
options.accept_insecure_certs = True
|
|
@@ -234,7 +234,12 @@ def driver_init(request):
|
|
|
234
234
|
proxy_server = request.config.proxy_server
|
|
235
235
|
else:
|
|
236
236
|
proxy_server = None
|
|
237
|
-
|
|
237
|
+
browser_options = getattr(request.cls, "browser_options", None)
|
|
238
|
+
driver = create_driver(
|
|
239
|
+
device,
|
|
240
|
+
proxy_server=proxy_server,
|
|
241
|
+
browser_options=browser_options,
|
|
242
|
+
)
|
|
238
243
|
driver.xrequestid = request.cls.xrequestid
|
|
239
244
|
request.cls.driver = request.config.driver = driver
|
|
240
245
|
request.config.get_fail_debug = _get_fail_debug
|
|
@@ -72,7 +72,8 @@ def timeout(seconds=5, error_message=os.strerror(errno.ETIME)):
|
|
|
72
72
|
|
|
73
73
|
@timeout(300)
|
|
74
74
|
def create_driver(
|
|
75
|
-
device, proxy_server=None, env_var='SE_DRIVER', default='chrome://'
|
|
75
|
+
device, proxy_server=None, env_var='SE_DRIVER', default='chrome://',
|
|
76
|
+
browser_options=None,
|
|
76
77
|
):
|
|
77
78
|
"""
|
|
78
79
|
Examples:
|
|
@@ -87,6 +88,8 @@ def create_driver(
|
|
|
87
88
|
"proxy_server": proxy_server,
|
|
88
89
|
"is_headless": os.environ.get("HEADLESS") == "Enabled",
|
|
89
90
|
}
|
|
91
|
+
if browser_options and 'chrome' in browser_options.__module__:
|
|
92
|
+
driver_options["browser_options"] = browser_options
|
|
90
93
|
|
|
91
94
|
driver_dsn = os.environ.get(env_var) or default
|
|
92
95
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|