pomcorn 0.7.2__tar.gz → 0.7.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.

Potentially problematic release.


This version of pomcorn might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pomcorn
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: Base implementation of Page Object Model
5
5
  Home-page: https://pypi.org/project/pomcorn/
6
6
  License: MIT
@@ -103,12 +103,18 @@ class Page(WebView):
103
103
  path: Relative URL.
104
104
 
105
105
  """
106
- app_root = app_root or cls.APP_ROOT
106
+ # hack to not specify app_root in each page init method
107
+ if app_root:
108
+ kwargs["app_root"] = app_root
109
+
107
110
  # We don't use `page.navigate_relative` here because we need to
108
111
  # navigate to relative url before page is initialized, since otherwise
109
112
  # `wait_until_loaded` method in page `__init__` method might fail.
110
- webdriver.get(cls._get_full_relative_url(app_root, path))
111
- page = cls(webdriver, app_root=app_root, **kwargs)
113
+ webdriver.get(
114
+ url=cls._get_full_relative_url(app_root or cls.APP_ROOT, path),
115
+ )
116
+
117
+ page = cls(webdriver, **kwargs)
112
118
  return page
113
119
 
114
120
  def refresh(self) -> None:
@@ -147,25 +153,19 @@ class Page(WebView):
147
153
  )
148
154
 
149
155
  def click_on_page(self) -> None:
150
- """Click on (1, 1) coordinates of `html` tag (page upper left corner).
156
+ """Click on (1, 1) coordinates of page (left upper corner).
151
157
 
152
158
  Allows you to move focus away from an element, for example, if it
153
159
  is currently unavailable for interaction.
154
160
 
155
161
  """
156
- from selenium.webdriver.common.action_chains import ActionChains
157
-
158
- from pomcorn import locators
159
-
160
- html_webelement = self.init_element(
161
- locator=locators.TagNameLocator("html"),
162
- ).get_element()
162
+ from selenium.webdriver.common.actions.action_builder import (
163
+ ActionBuilder,
164
+ )
163
165
 
164
- ActionChains(self.webdriver).move_to_element_with_offset(
165
- to_element=html_webelement,
166
- xoffset=1, # cspell:disable-line
167
- yoffset=1, # cspell:disable-line
168
- ).click().perform()
166
+ action = ActionBuilder(self.webdriver)
167
+ action.pointer_action.move_to_location(1, 1).click()
168
+ action.perform()
169
169
 
170
170
  @staticmethod
171
171
  def _get_full_relative_url(app_root: str, relative_url: str) -> str:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pomcorn"
3
- version = "0.7.2"
3
+ version = "0.7.4"
4
4
  description = "Base implementation of Page Object Model"
5
5
  authors = [
6
6
  "Saritasa <pypi@saritasa.com>",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes