pomcorn 0.7.1__py3-none-any.whl → 0.7.2__py3-none-any.whl

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.

pomcorn/page.py CHANGED
@@ -108,7 +108,7 @@ class Page(WebView):
108
108
  # navigate to relative url before page is initialized, since otherwise
109
109
  # `wait_until_loaded` method in page `__init__` method might fail.
110
110
  webdriver.get(cls._get_full_relative_url(app_root, path))
111
- page = cls(webdriver, app_root=app_root)
111
+ page = cls(webdriver, app_root=app_root, **kwargs)
112
112
  return page
113
113
 
114
114
  def refresh(self) -> None:
@@ -147,7 +147,7 @@ class Page(WebView):
147
147
  )
148
148
 
149
149
  def click_on_page(self) -> None:
150
- """Click on (1, 1) coordinates in the upper left corner of the page.
150
+ """Click on (1, 1) coordinates of `html` tag (page upper left corner).
151
151
 
152
152
  Allows you to move focus away from an element, for example, if it
153
153
  is currently unavailable for interaction.
@@ -155,7 +155,14 @@ class Page(WebView):
155
155
  """
156
156
  from selenium.webdriver.common.action_chains import ActionChains
157
157
 
158
- ActionChains(self.webdriver).move_by_offset(
158
+ from pomcorn import locators
159
+
160
+ html_webelement = self.init_element(
161
+ locator=locators.TagNameLocator("html"),
162
+ ).get_element()
163
+
164
+ ActionChains(self.webdriver).move_to_element_with_offset(
165
+ to_element=html_webelement,
159
166
  xoffset=1, # cspell:disable-line
160
167
  yoffset=1, # cspell:disable-line
161
168
  ).click().perform()
@@ -168,6 +175,12 @@ class Page(WebView):
168
175
  relative_url (str): Relative URL
169
176
 
170
177
  """
171
- if not relative_url.startswith("/"):
172
- relative_url = f"/{relative_url}"
173
- return f"{app_root}{relative_url}"
178
+ if app_root.endswith("/"):
179
+ # https://www.youtube.com/ -> https://www.youtube.com
180
+ app_root = app_root[:-1]
181
+
182
+ if relative_url.startswith("/"):
183
+ # /watch_list -> watch_list
184
+ relative_url = relative_url[1:]
185
+
186
+ return f"{app_root}/{relative_url}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pomcorn
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Base implementation of Page Object Model
5
5
  Home-page: https://pypi.org/project/pomcorn/
6
6
  License: MIT
@@ -7,11 +7,11 @@ pomcorn/exceptions.py,sha256=8ZOmrybDwvEVZRLQzyozjRNhJvSLbablaFwGFUVMhrU,1131
7
7
  pomcorn/locators/__init__.py,sha256=hNSlfmz3y-LI4PXF5VIwX8J5WSalyE2wmzuYc6kNxMA,708
8
8
  pomcorn/locators/base_locators.py,sha256=B4SDSKi5j7kqwbxllnMHU9BKBJzn_dzNRphPQ2hTuss,7065
9
9
  pomcorn/locators/xpath_locators.py,sha256=OjwTdHwqDfX_5aP0N6YeFwRl2gPr8ZNQny8yLxBrVCo,7264
10
- pomcorn/page.py,sha256=JdCDDVP4q2r5HwxSRnD9Sg43tgpCyrqu_jEux2E4ARY,5475
10
+ pomcorn/page.py,sha256=W4sGiYg8NfScsq20pMohYZdQC868i78k1Qd-XYeD2QI,5876
11
11
  pomcorn/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  pomcorn/waits_conditions.py,sha256=E8sLfBvIV2EO91Mm5KyKXB5IGEB9gUWza3XPE4_aCQE,3528
13
13
  pomcorn/web_view.py,sha256=PlwEVgdOwFZXJY2WuUT2C2wyK1xOBJne5-A_FOuwsQI,14209
14
- pomcorn-0.7.1.dist-info/LICENSE,sha256=1vmhQNp1dDH8ksJ199LuG4oKz5D4ZvNccPcFckiG2S4,1091
15
- pomcorn-0.7.1.dist-info/METADATA,sha256=plUXXe1KZnwCkzQm8M7XmRUMK0iSt1t11AW5LDfsMHo,5949
16
- pomcorn-0.7.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
17
- pomcorn-0.7.1.dist-info/RECORD,,
14
+ pomcorn-0.7.2.dist-info/LICENSE,sha256=1vmhQNp1dDH8ksJ199LuG4oKz5D4ZvNccPcFckiG2S4,1091
15
+ pomcorn-0.7.2.dist-info/METADATA,sha256=Tb96V2WQQJgVPE0-tbXb5FH7_1yjyUaOExaAAJcXPBc,5949
16
+ pomcorn-0.7.2.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
17
+ pomcorn-0.7.2.dist-info/RECORD,,