mops 3.5.0__tar.gz → 3.5.2__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 (54) hide show
  1. {mops-3.5.0 → mops-3.5.2}/PKG-INFO +1 -1
  2. {mops-3.5.0 → mops-3.5.2}/mops/__init__.py +1 -1
  3. {mops-3.5.0 → mops-3.5.2}/mops/abstraction/driver_wrapper_abc.py +2 -0
  4. {mops-3.5.0 → mops-3.5.2}/mops/base/driver_wrapper.py +2 -0
  5. {mops-3.5.0 → mops-3.5.2}/mops/playwright/play_driver.py +14 -4
  6. {mops-3.5.0 → mops-3.5.2}/mops/selenium/core/core_driver.py +6 -1
  7. {mops-3.5.0 → mops-3.5.2}/mops/utils/decorators.py +1 -3
  8. {mops-3.5.0 → mops-3.5.2}/mops.egg-info/PKG-INFO +1 -1
  9. {mops-3.5.0 → mops-3.5.2}/README.md +0 -0
  10. {mops-3.5.0 → mops-3.5.2}/mops/abstraction/element_abc.py +0 -0
  11. {mops-3.5.0 → mops-3.5.2}/mops/abstraction/mixin_abc.py +0 -0
  12. {mops-3.5.0 → mops-3.5.2}/mops/abstraction/page_abc.py +0 -0
  13. {mops-3.5.0 → mops-3.5.2}/mops/base/element.py +0 -0
  14. {mops-3.5.0 → mops-3.5.2}/mops/base/group.py +0 -0
  15. {mops-3.5.0 → mops-3.5.2}/mops/base/page.py +0 -0
  16. {mops-3.5.0 → mops-3.5.2}/mops/exceptions.py +0 -0
  17. {mops-3.5.0 → mops-3.5.2}/mops/js_scripts.py +0 -0
  18. {mops-3.5.0 → mops-3.5.2}/mops/keyboard_keys.py +0 -0
  19. {mops-3.5.0 → mops-3.5.2}/mops/mixins/capabilities.py +0 -0
  20. {mops-3.5.0 → mops-3.5.2}/mops/mixins/driver_mixin.py +0 -0
  21. {mops-3.5.0 → mops-3.5.2}/mops/mixins/internal_mixin.py +0 -0
  22. {mops-3.5.0 → mops-3.5.2}/mops/mixins/native_context.py +0 -0
  23. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/box.py +0 -0
  24. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/driver.py +0 -0
  25. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/location.py +0 -0
  26. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/locator.py +0 -0
  27. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/locator_type.py +0 -0
  28. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/scrolls.py +0 -0
  29. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/size.py +0 -0
  30. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/visual_comaprison_mixin.py +0 -0
  31. {mops-3.5.0 → mops-3.5.2}/mops/mixins/objects/wait_result.py +0 -0
  32. {mops-3.5.0 → mops-3.5.2}/mops/playwright/play_element.py +0 -0
  33. {mops-3.5.0 → mops-3.5.2}/mops/playwright/play_page.py +0 -0
  34. {mops-3.5.0 → mops-3.5.2}/mops/selenium/core/core_element.py +0 -0
  35. {mops-3.5.0 → mops-3.5.2}/mops/selenium/core/core_page.py +0 -0
  36. {mops-3.5.0 → mops-3.5.2}/mops/selenium/driver/mobile_driver.py +0 -0
  37. {mops-3.5.0 → mops-3.5.2}/mops/selenium/driver/web_driver.py +0 -0
  38. {mops-3.5.0 → mops-3.5.2}/mops/selenium/elements/mobile_element.py +0 -0
  39. {mops-3.5.0 → mops-3.5.2}/mops/selenium/elements/web_element.py +0 -0
  40. {mops-3.5.0 → mops-3.5.2}/mops/selenium/pages/mobile_page.py +0 -0
  41. {mops-3.5.0 → mops-3.5.2}/mops/selenium/pages/web_page.py +0 -0
  42. {mops-3.5.0 → mops-3.5.2}/mops/selenium/sel_utils.py +0 -0
  43. {mops-3.5.0 → mops-3.5.2}/mops/shared_utils.py +0 -0
  44. {mops-3.5.0 → mops-3.5.2}/mops/utils/internal_utils.py +0 -0
  45. {mops-3.5.0 → mops-3.5.2}/mops/utils/logs.py +0 -0
  46. {mops-3.5.0 → mops-3.5.2}/mops/utils/previous_object_driver.py +0 -0
  47. {mops-3.5.0 → mops-3.5.2}/mops/utils/selector_synchronizer.py +0 -0
  48. {mops-3.5.0 → mops-3.5.2}/mops/visual_comparison.py +0 -0
  49. {mops-3.5.0 → mops-3.5.2}/mops.egg-info/SOURCES.txt +0 -0
  50. {mops-3.5.0 → mops-3.5.2}/mops.egg-info/dependency_links.txt +0 -0
  51. {mops-3.5.0 → mops-3.5.2}/mops.egg-info/requires.txt +0 -0
  52. {mops-3.5.0 → mops-3.5.2}/mops.egg-info/top_level.txt +0 -0
  53. {mops-3.5.0 → mops-3.5.2}/pyproject.toml +0 -0
  54. {mops-3.5.0 → mops-3.5.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mops
3
- Version: 3.5.0
3
+ Version: 3.5.2
4
4
  Summary: Wrapper of Selenium, Appium and Playwright with single API
5
5
  Author-email: Podolian Vladimir <vladimir.podolyan64@gmail.com>
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
1
  """Wrapper of Selenium, Appium and Playwright with a single API."""
2
2
 
3
- __version__ = '3.5.0'
3
+ __version__ = '3.5.2'
4
4
  __project_name__ = 'mops'
@@ -44,6 +44,8 @@ class DriverWrapperABC(ABC):
44
44
  is_simulator: bool = False
45
45
  is_real_device: bool = False
46
46
 
47
+ is_cdp: bool = False
48
+
47
49
  browser_name: str | None = None
48
50
 
49
51
  @cached_property
@@ -128,6 +128,8 @@ class DriverWrapper(InternalMixin, Logging, DriverWrapperABC):
128
128
  is_simulator: bool = False
129
129
  is_real_device: bool = False
130
130
 
131
+ is_cdp: bool = False
132
+
131
133
  browser_name: str | None = None
132
134
 
133
135
  def __new__(cls, *args: Any, **kwargs: Any) -> Self:
@@ -175,12 +175,19 @@ class PlayDriver(Logging, DriverWrapperABC):
175
175
 
176
176
  :return: :obj:`None`
177
177
  """
178
- if trace_path:
178
+ if trace_path and not self.is_cdp:
179
179
  with contextlib.suppress(PlaywrightError):
180
180
  self.context.tracing.stop(path=trace_path)
181
181
 
182
- self._base_driver.close()
183
- self.context.close()
182
+ if self.is_cdp:
183
+ with contextlib.suppress(PlaywrightError):
184
+ self._base_driver.close()
185
+
186
+ with contextlib.suppress(PlaywrightError):
187
+ self.context.close()
188
+ else:
189
+ self._base_driver.close()
190
+ self.context.close()
184
191
 
185
192
  def set_cookie(self, cookies: list[dict]) -> PlayDriver:
186
193
  """
@@ -298,7 +305,10 @@ class PlayDriver(Logging, DriverWrapperABC):
298
305
 
299
306
  :return: The size of the inner window as a :class:`.Size` object.
300
307
  """
301
- return Size(**self.driver.viewport_size)
308
+ viewport = self.driver.viewport_size
309
+ if viewport is None:
310
+ return Size(width=0, height=0)
311
+ return Size(**viewport)
302
312
 
303
313
  def get_window_size(self) -> Size:
304
314
  """
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import contextlib
3
4
  from functools import cached_property
4
5
  import time
5
6
  from typing import TYPE_CHECKING, Any
@@ -223,7 +224,11 @@ class CoreDriver(Logging, DriverWrapperABC):
223
224
 
224
225
  :return: :obj:`None`
225
226
  """
226
- self.driver.quit()
227
+ if self.is_cdp:
228
+ with contextlib.suppress(SeleniumWebDriverException):
229
+ self.driver.quit()
230
+ else:
231
+ self.driver.quit()
227
232
 
228
233
  def set_cookie(self, cookies: list[dict]) -> CoreDriver:
229
234
  """
@@ -69,7 +69,6 @@ def wait_condition(method: Callable) -> Callable:
69
69
  validate_timeout(timeout)
70
70
  validate_silent(silent)
71
71
 
72
- should_increase_delay = self.driver_wrapper.is_appium
73
72
  delay = WAIT_METHODS_DELAY
74
73
  is_log_needed = not silent
75
74
  start_time = time.time()
@@ -89,8 +88,7 @@ def wait_condition(method: Callable) -> Callable:
89
88
 
90
89
  time.sleep(delay)
91
90
 
92
- if should_increase_delay:
93
- delay = increase_delay(delay)
91
+ delay = increase_delay(delay)
94
92
 
95
93
  result.exc._timeout = timeout
96
94
  raise result.exc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mops
3
- Version: 3.5.0
3
+ Version: 3.5.2
4
4
  Summary: Wrapper of Selenium, Appium and Playwright with single API
5
5
  Author-email: Podolian Vladimir <vladimir.podolyan64@gmail.com>
6
6
  License: MIT
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