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.
Files changed (64) hide show
  1. {promium-3.7.7 → promium-3.7.8}/PKG-INFO +1 -1
  2. {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/PKG-INFO +1 -1
  3. {promium-3.7.7 → promium-3.7.8}/promium/_diag.py +12 -13
  4. {promium-3.7.7 → promium-3.7.8}/promium/assertions.py +6 -5
  5. {promium-3.7.7 → promium-3.7.8}/promium/base.py +9 -6
  6. {promium-3.7.7 → promium-3.7.8}/promium/expected_conditions.py +3 -3
  7. {promium-3.7.7 → promium-3.7.8}/setup.py +1 -1
  8. {promium-3.7.7 → promium-3.7.8}/LICENSE +0 -0
  9. {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/SOURCES.txt +0 -0
  10. {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/dependency_links.txt +0 -0
  11. {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/entry_points.txt +0 -0
  12. {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/requires.txt +0 -0
  13. {promium-3.7.7 → promium-3.7.8}/Promium.egg-info/top_level.txt +0 -0
  14. {promium-3.7.7 → promium-3.7.8}/README.rst +0 -0
  15. {promium-3.7.7 → promium-3.7.8}/doc/__init__.py +0 -0
  16. {promium-3.7.7 → promium-3.7.8}/doc/conf.py +0 -0
  17. {promium-3.7.7 → promium-3.7.8}/promium/__init__.py +0 -0
  18. {promium-3.7.7 → promium-3.7.8}/promium/browsers.py +0 -0
  19. {promium-3.7.7 → promium-3.7.8}/promium/common.py +0 -0
  20. {promium-3.7.7 → promium-3.7.8}/promium/device_config.py +0 -0
  21. {promium-3.7.7 → promium-3.7.8}/promium/elements/__init__.py +0 -0
  22. {promium-3.7.7 → promium-3.7.8}/promium/elements/checkbox.py +0 -0
  23. {promium-3.7.7 → promium-3.7.8}/promium/elements/drop_downs.py +0 -0
  24. {promium-3.7.7 → promium-3.7.8}/promium/elements/frame.py +0 -0
  25. {promium-3.7.7 → promium-3.7.8}/promium/elements/input_field.py +0 -0
  26. {promium-3.7.7 → promium-3.7.8}/promium/elements/link.py +0 -0
  27. {promium-3.7.7 → promium-3.7.8}/promium/elements/multiselect_listbox.py +0 -0
  28. {promium-3.7.7 → promium-3.7.8}/promium/elements/radio_button.py +0 -0
  29. {promium-3.7.7 → promium-3.7.8}/promium/elements/textarea_field.py +0 -0
  30. {promium-3.7.7 → promium-3.7.8}/promium/elements/upload_button.py +0 -0
  31. {promium-3.7.7 → promium-3.7.8}/promium/exceptions.py +0 -0
  32. {promium-3.7.7 → promium-3.7.8}/promium/helpers.py +0 -0
  33. {promium-3.7.7 → promium-3.7.8}/promium/logger.py +0 -0
  34. {promium-3.7.7 → promium-3.7.8}/promium/plugin.py +0 -0
  35. {promium-3.7.7 → promium-3.7.8}/promium/support/__init__.py +0 -0
  36. {promium-3.7.7 → promium-3.7.8}/promium/support/settings.py +0 -0
  37. {promium-3.7.7 → promium-3.7.8}/promium/test_case.py +0 -0
  38. {promium-3.7.7 → promium-3.7.8}/promium/waits.py +0 -0
  39. {promium-3.7.7 → promium-3.7.8}/pyproject.toml +0 -0
  40. {promium-3.7.7 → promium-3.7.8}/setup.cfg +0 -0
  41. {promium-3.7.7 → promium-3.7.8}/tests/__init__.py +0 -0
  42. {promium-3.7.7 → promium-3.7.8}/tests/config.py +0 -0
  43. {promium-3.7.7 → promium-3.7.8}/tests/conftest.py +0 -0
  44. {promium-3.7.7 → promium-3.7.8}/tests/pages/__init__.py +0 -0
  45. {promium-3.7.7 → promium-3.7.8}/tests/pages/catalog_404_page.py +0 -0
  46. {promium-3.7.7 → promium-3.7.8}/tests/pages/catalog_gallery_page.py +0 -0
  47. {promium-3.7.7 → promium-3.7.8}/tests/settings/__init__.py +0 -0
  48. {promium-3.7.7 → promium-3.7.8}/tests/settings/test_base.py +0 -0
  49. {promium-3.7.7 → promium-3.7.8}/tests/settings/test_chrome.py +0 -0
  50. {promium-3.7.7 → promium-3.7.8}/tests/settings/test_edge.py +0 -0
  51. {promium-3.7.7 → promium-3.7.8}/tests/settings/test_firefox.py +0 -0
  52. {promium-3.7.7 → promium-3.7.8}/tests/settings/test_ie.py +0 -0
  53. {promium-3.7.7 → promium-3.7.8}/tests/settings/test_opera.py +0 -0
  54. {promium-3.7.7 → promium-3.7.8}/tests/test_catalog_404.py +0 -0
  55. {promium-3.7.7 → promium-3.7.8}/tests/test_catalog_gallery.py +0 -0
  56. {promium-3.7.7 → promium-3.7.8}/tests/test_enviroment.py +0 -0
  57. {promium-3.7.7 → promium-3.7.8}/tests/test_exceptions.py +0 -0
  58. {promium-3.7.7 → promium-3.7.8}/tests/test_expected_conditions.py +0 -0
  59. {promium-3.7.7 → promium-3.7.8}/tests/test_helpers.py +0 -0
  60. {promium-3.7.7 → promium-3.7.8}/tests/test_requests.py +0 -0
  61. {promium-3.7.7 → promium-3.7.8}/tests/test_soft_asserts.py +0 -0
  62. {promium-3.7.7 → promium-3.7.8}/tests/test_test_cases.py +0 -0
  63. {promium-3.7.7 → promium-3.7.8}/tests/test_waits.py +0 -0
  64. {promium-3.7.7 → promium-3.7.8}/tests/urls.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Promium
3
- Version: 3.7.7
3
+ Version: 3.7.8
4
4
  Summary: Selenium wrapper for testing Web UI
5
5
  Author: Denis Korytkin, Nataliia Guieva, Roman Zaporozhets, Vladimir Kritov, Oleh Dykusha
6
6
  Project-URL: Home page, https://none
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Promium
3
- Version: 3.7.7
3
+ Version: 3.7.8
4
4
  Summary: Selenium wrapper for testing Web UI
5
5
  Author: Denis Korytkin, Nataliia Guieva, Roman Zaporozhets, Vladimir Kritov, Oleh Dykusha
6
6
  Project-URL: Home page, https://none
@@ -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
- return (f.filename, f.lineno)
88
- for f in stack:
89
- fn = f.filename.replace("\\", "/")
90
- if "/promium/" in fn or "site-packages/" in fn or "/_pytest/" in fn:
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
- cs = _user_callsite()
312
- if cs:
313
- abs_path, line_no = cs
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(" " * CALLSITE_CODE_INDENT + src)
320
- blocks.append("\n".join(lines))
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
- for frame in inspect.stack()[2:]:
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
- return f"↳ at {self._relpath(fn)}:{frame.lineno}"
111
- f = inspect.stack()[2]
112
- return f"↳ at {self._relpath(f.filename)}:{f.lineno}"
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
- self.previous_window_handle = self.driver.current_window_handle
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
- switch_to_window(self.driver, self.previous_window_handle)
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
- switch_to_window(self.driver, self.previous_window_handle)
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, some covers",
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, NoReturn
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) -> NoReturn:
11
+ def call_method(self) -> Any:
12
12
  raise PromiumException("Not implemented")
13
13
 
14
- def __call__(self, driver: Any) -> bool:
14
+ def __call__(self, driver: Any) -> Any:
15
15
  if self.with_refresh:
16
16
  driver.refresh()
17
17
  return self.call_method()
@@ -19,7 +19,7 @@ LONG_DESCRIPTION = Path("README.rst").read_text(encoding="utf-8")
19
19
 
20
20
  setup(
21
21
  name="Promium",
22
- version="3.7.7",
22
+ version="3.7.8",
23
23
  install_requires=REQUIREMENTS,
24
24
  author=(
25
25
  "Denis Korytkin, Nataliia Guieva, "
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