Promium 3.7.7__tar.gz → 3.7.8__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.7.7 → promium-3.7.8}/PKG-INFO +1 -1
- {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/PKG-INFO +1 -1
- {promium-3.7.7 → promium-3.7.8}/promium/_diag.py +12 -13
- {promium-3.7.7 → promium-3.7.8}/promium/assertions.py +6 -5
- {promium-3.7.7 → promium-3.7.8}/promium/base.py +9 -6
- {promium-3.7.7 → promium-3.7.8}/promium/expected_conditions.py +3 -3
- {promium-3.7.7 → promium-3.7.8}/setup.py +1 -1
- {promium-3.7.7 → promium-3.7.8}/LICENSE +0 -0
- {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/SOURCES.txt +0 -0
- {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/dependency_links.txt +0 -0
- {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/entry_points.txt +0 -0
- {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/requires.txt +0 -0
- {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/top_level.txt +0 -0
- {promium-3.7.7 → promium-3.7.8}/README.rst +0 -0
- {promium-3.7.7 → promium-3.7.8}/doc/__init__.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/doc/conf.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/__init__.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/browsers.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/common.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/device_config.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/__init__.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/checkbox.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/drop_downs.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/frame.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/input_field.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/link.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/multiselect_listbox.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/radio_button.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/textarea_field.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/elements/upload_button.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/exceptions.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/helpers.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/logger.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/plugin.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/support/__init__.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/support/settings.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/test_case.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/promium/waits.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/pyproject.toml +0 -0
- {promium-3.7.7 → promium-3.7.8}/setup.cfg +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/__init__.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/config.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/conftest.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/pages/__init__.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/pages/catalog_404_page.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/pages/catalog_gallery_page.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/settings/__init__.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/settings/test_base.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/settings/test_chrome.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/settings/test_edge.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/settings/test_firefox.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/settings/test_ie.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/settings/test_opera.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_catalog_404.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_catalog_gallery.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_enviroment.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_exceptions.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_expected_conditions.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_helpers.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_requests.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_soft_asserts.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_test_cases.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/test_waits.py +0 -0
- {promium-3.7.7 → promium-3.7.8}/tests/urls.py +0 -0
|
@@ -81,16 +81,14 @@ def _user_callsite() -> tuple[str, int] | None:
|
|
|
81
81
|
stack = inspect.stack()
|
|
82
82
|
except Exception:
|
|
83
83
|
return None
|
|
84
|
+
except_list = []
|
|
84
85
|
for f in stack:
|
|
85
86
|
fn = f.filename.replace("\\", "/")
|
|
86
87
|
if "/tests/" in fn:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
continue
|
|
92
|
-
return (f.filename, f.lineno)
|
|
93
|
-
return None
|
|
88
|
+
if "/promium/" in fn or "site-packages/" in fn or "/_pytest/" in fn:
|
|
89
|
+
continue
|
|
90
|
+
except_list.append((f.filename, f.lineno))
|
|
91
|
+
return except_list
|
|
94
92
|
|
|
95
93
|
|
|
96
94
|
def _dedup_consecutive(items: list[str]) -> list[str]:
|
|
@@ -308,16 +306,17 @@ def build_digest(
|
|
|
308
306
|
blocks.append("— Actions: \n" + actions)
|
|
309
307
|
|
|
310
308
|
if SHOW_CALLSITE:
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
309
|
+
trace_lines = []
|
|
310
|
+
for i, (abs_path, line_no) in enumerate(_user_callsite()[::-1]):
|
|
311
|
+
indent = " " * (i * 4)
|
|
314
312
|
rel = _rel(abs_path)
|
|
315
|
-
lines = [f"↳ at {rel}:{line_no}"]
|
|
313
|
+
lines = [f"{indent}↳ at {rel}:{line_no}"]
|
|
316
314
|
if SHOW_CALLSITE_CODELINE:
|
|
317
315
|
src = _read_source_line(abs_path, line_no, CALLSITE_CODE_MAXLEN)
|
|
318
316
|
if src:
|
|
319
|
-
lines.append("
|
|
320
|
-
|
|
317
|
+
lines.append(f"{indent}{' ' * CALLSITE_CODE_INDENT}{src}")
|
|
318
|
+
trace_lines.append("\n".join(lines))
|
|
319
|
+
blocks.append("\n".join(trace_lines))
|
|
321
320
|
|
|
322
321
|
if origin and origin[0]:
|
|
323
322
|
blocks.append(f"↳ locator at {_rel(origin[0])}:{origin[1] or '?'}")
|
|
@@ -103,13 +103,14 @@ class BaseSoftAssertion:
|
|
|
103
103
|
|
|
104
104
|
def _callsite_line(self) -> str:
|
|
105
105
|
"""Return callsite line in format ↳ at path:lineno."""
|
|
106
|
-
|
|
106
|
+
return_value = ""
|
|
107
|
+
for frame in inspect.stack()[2:][::-1]:
|
|
107
108
|
fn = frame.filename.replace("\\", "/")
|
|
108
|
-
if "/site-packages/" in fn:
|
|
109
|
+
if "/promium/" in fn or "site-packages/" in fn or "/_pytest/" in fn:
|
|
109
110
|
continue
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return
|
|
111
|
+
if "/tests/" in fn:
|
|
112
|
+
return_value += f"↳ at {self._relpath(fn)}:{frame.lineno}\n"
|
|
113
|
+
return return_value
|
|
113
114
|
|
|
114
115
|
def _format_error(self, error_msg: str, *, with_screen: bool) -> str:
|
|
115
116
|
"""Build final error text."""
|
|
@@ -187,7 +187,10 @@ class Page:
|
|
|
187
187
|
self, driver: WebDriver, monkeypatch: pytest.MonkeyPatch = None
|
|
188
188
|
) -> None:
|
|
189
189
|
self._driver = driver
|
|
190
|
-
|
|
190
|
+
if not hasattr(self.driver, "previous_window_handle"):
|
|
191
|
+
self.driver.previous_window_handle = (
|
|
192
|
+
self.driver.current_window_handle
|
|
193
|
+
)
|
|
191
194
|
self.monkeypatch = monkeypatch
|
|
192
195
|
|
|
193
196
|
@property
|
|
@@ -292,23 +295,23 @@ class Page:
|
|
|
292
295
|
def switch_to_tab(self) -> None:
|
|
293
296
|
"""Switch to a newly opened browser tab."""
|
|
294
297
|
new_window = wait_until_new_window_is_opened(
|
|
295
|
-
self.driver, self.previous_window_handle
|
|
298
|
+
self.driver, self.driver.previous_window_handle
|
|
296
299
|
)
|
|
297
300
|
switch_to_window(self.driver, new_window)
|
|
298
301
|
|
|
299
302
|
def switch_previous_tab(self) -> None:
|
|
300
303
|
"""Switch back to the previously active tab."""
|
|
301
|
-
switch_to_window(self.driver, self.previous_window_handle)
|
|
304
|
+
switch_to_window(self.driver, self.driver.previous_window_handle)
|
|
302
305
|
|
|
303
306
|
def open_tab(self) -> None:
|
|
304
307
|
"""Open new tab and switch to it."""
|
|
305
308
|
self.driver.execute_script("window.open();")
|
|
306
|
-
|
|
309
|
+
self.switch_to_tab()
|
|
307
310
|
|
|
308
311
|
def close_tab(self) -> None:
|
|
309
312
|
"""Close current tab and switch to the previously tab."""
|
|
310
313
|
self.driver.close()
|
|
311
|
-
|
|
314
|
+
self.switch_previous_tab()
|
|
312
315
|
|
|
313
316
|
def scroll_to_bottom(self) -> None:
|
|
314
317
|
"""Scroll to the bottom of the page."""
|
|
@@ -1162,7 +1165,7 @@ class ElementBase(Base):
|
|
|
1162
1165
|
)
|
|
1163
1166
|
digest = build_digest(
|
|
1164
1167
|
self.driver,
|
|
1165
|
-
title="Click failed,
|
|
1168
|
+
title="Click failed, something is covering",
|
|
1166
1169
|
locator=css,
|
|
1167
1170
|
condition="webelement.click()",
|
|
1168
1171
|
css_for_probe=css_probe,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any
|
|
1
|
+
from typing import Any
|
|
2
2
|
|
|
3
3
|
from promium.exceptions import PromiumException
|
|
4
4
|
|
|
@@ -8,10 +8,10 @@ class BaseElementConditionWithRefresh:
|
|
|
8
8
|
self.element = element
|
|
9
9
|
self.with_refresh = with_refresh
|
|
10
10
|
|
|
11
|
-
def call_method(self) ->
|
|
11
|
+
def call_method(self) -> Any:
|
|
12
12
|
raise PromiumException("Not implemented")
|
|
13
13
|
|
|
14
|
-
def __call__(self, driver: Any) ->
|
|
14
|
+
def __call__(self, driver: Any) -> Any:
|
|
15
15
|
if self.with_refresh:
|
|
16
16
|
driver.refresh()
|
|
17
17
|
return self.call_method()
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|