Promium 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 (58) hide show
  1. {Promium-3.5.0 → Promium-3.5.2}/PKG-INFO +1 -1
  2. {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/PKG-INFO +1 -1
  3. {Promium-3.5.0 → Promium-3.5.2}/promium/base.py +13 -12
  4. {Promium-3.5.0 → Promium-3.5.2}/promium/test_case.py +6 -2
  5. {Promium-3.5.0 → Promium-3.5.2}/setup.py +1 -1
  6. {Promium-3.5.0 → Promium-3.5.2}/LICENSE +0 -0
  7. {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/SOURCES.txt +0 -0
  8. {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/dependency_links.txt +0 -0
  9. {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/entry_points.txt +0 -0
  10. {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/requires.txt +0 -0
  11. {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/top_level.txt +0 -0
  12. {Promium-3.5.0 → Promium-3.5.2}/README.rst +0 -0
  13. {Promium-3.5.0 → Promium-3.5.2}/doc/__init__.py +0 -0
  14. {Promium-3.5.0 → Promium-3.5.2}/doc/conf.py +0 -0
  15. {Promium-3.5.0 → Promium-3.5.2}/promium/__init__.py +0 -0
  16. {Promium-3.5.0 → Promium-3.5.2}/promium/assertions.py +0 -0
  17. {Promium-3.5.0 → Promium-3.5.2}/promium/browsers.py +0 -0
  18. {Promium-3.5.0 → Promium-3.5.2}/promium/common.py +0 -0
  19. {Promium-3.5.0 → Promium-3.5.2}/promium/device_config.py +0 -0
  20. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/__init__.py +0 -0
  21. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/checkbox.py +0 -0
  22. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/drop_downs.py +0 -0
  23. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/frame.py +0 -0
  24. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/input_field.py +0 -0
  25. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/link.py +0 -0
  26. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/multiselect_listbox.py +0 -0
  27. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/radio_button.py +0 -0
  28. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/textarea_field.py +0 -0
  29. {Promium-3.5.0 → Promium-3.5.2}/promium/elements/upload_button.py +0 -0
  30. {Promium-3.5.0 → Promium-3.5.2}/promium/exceptions.py +0 -0
  31. {Promium-3.5.0 → Promium-3.5.2}/promium/expected_conditions.py +0 -0
  32. {Promium-3.5.0 → Promium-3.5.2}/promium/helpers.py +0 -0
  33. {Promium-3.5.0 → Promium-3.5.2}/promium/logger.py +0 -0
  34. {Promium-3.5.0 → Promium-3.5.2}/promium/plugin.py +0 -0
  35. {Promium-3.5.0 → Promium-3.5.2}/promium/support/__init__.py +0 -0
  36. {Promium-3.5.0 → Promium-3.5.2}/promium/support/settings.py +0 -0
  37. {Promium-3.5.0 → Promium-3.5.2}/promium/waits.py +0 -0
  38. {Promium-3.5.0 → Promium-3.5.2}/setup.cfg +0 -0
  39. {Promium-3.5.0 → Promium-3.5.2}/tests/__init__.py +0 -0
  40. {Promium-3.5.0 → Promium-3.5.2}/tests/config.py +0 -0
  41. {Promium-3.5.0 → Promium-3.5.2}/tests/conftest.py +0 -0
  42. {Promium-3.5.0 → Promium-3.5.2}/tests/pages/__init__.py +0 -0
  43. {Promium-3.5.0 → Promium-3.5.2}/tests/pages/catalog_404_page.py +0 -0
  44. {Promium-3.5.0 → Promium-3.5.2}/tests/pages/catalog_gallery_page.py +0 -0
  45. {Promium-3.5.0 → Promium-3.5.2}/tests/settings/__init__.py +0 -0
  46. {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_base.py +0 -0
  47. {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_chrome.py +0 -0
  48. {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_edge.py +0 -0
  49. {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_firefox.py +0 -0
  50. {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_ie.py +0 -0
  51. {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_opera.py +0 -0
  52. {Promium-3.5.0 → Promium-3.5.2}/tests/test_catalog_404.py +0 -0
  53. {Promium-3.5.0 → Promium-3.5.2}/tests/test_catalog_gallery.py +0 -0
  54. {Promium-3.5.0 → Promium-3.5.2}/tests/test_enviroment.py +0 -0
  55. {Promium-3.5.0 → Promium-3.5.2}/tests/test_requests.py +0 -0
  56. {Promium-3.5.0 → Promium-3.5.2}/tests/test_soft_asserts.py +0 -0
  57. {Promium-3.5.0 → Promium-3.5.2}/tests/test_waits.py +0 -0
  58. {Promium-3.5.0 → Promium-3.5.2}/tests/urls.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Promium
3
- Version: 3.5.0
3
+ Version: 3.5.2
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.5.0
3
+ Version: 3.5.2
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
@@ -14,7 +14,6 @@ from selenium.common.exceptions import (
14
14
  NoSuchElementException,
15
15
  TimeoutException
16
16
  )
17
- from selenium.webdriver.remote.webdriver import WebDriver
18
17
  from selenium.webdriver.remote.webelement import WebElement
19
18
  from selenium.webdriver.support import expected_conditions as EC
20
19
  from selenium.webdriver.common.action_chains import ActionChains
@@ -103,13 +102,14 @@ def highlight_element(func):
103
102
  return wrapper
104
103
 
105
104
 
106
- def get_web_driver(driver): # TODO: delete
107
- if isinstance(driver, WebDriver):
108
- return driver
109
- elif isinstance(driver, WebElement):
110
- return get_web_driver(driver._parent)
111
- error = 'Wrong driver instance. Supported WebDriver and WebElement only'
112
- raise PromiumException(error)
105
+ def text_to_be_present_in_element(element, text_):
106
+ def _predicate(driver):
107
+ try:
108
+ return text_ in element.lookup().text
109
+ except StaleElementReferenceException:
110
+ return False
111
+
112
+ return _predicate
113
113
 
114
114
 
115
115
  class Page(object):
@@ -133,12 +133,14 @@ class Page(object):
133
133
  if not self.url:
134
134
  raise PromiumException("Can't open page without url")
135
135
  start = time.time()
136
+ url = self.url.format(**kwargs)
137
+ log.info(f'Open Page: {url}')
136
138
  try:
137
- self.driver.get(self.url.format(**kwargs))
139
+ self.driver.get(url)
138
140
  except TimeoutException:
139
141
  log.error(f"[PROMIUM] Page load time: {time.time() - start}")
140
142
  raise
141
- return self.url.format(**kwargs)
143
+ return url
142
144
 
143
145
  @logger_for_loading_page
144
146
  def refresh(self):
@@ -746,11 +748,10 @@ class Element(ElementBase):
746
748
  )
747
749
 
748
750
  def wait_for_text_present(self, text):
749
- params = (self.by, self.locator)
750
751
  return wait_until(
751
752
  driver=self.driver,
752
753
  seconds=10,
753
- expression=EC.text_to_be_present_in_element(params, text),
754
+ expression=text_to_be_present_in_element(self, text),
754
755
  msg=f"Text: {text}, does not appear after 10 seconds"
755
756
  )
756
757
 
@@ -199,6 +199,7 @@ class WebDriverTestCase(TestCase, WebDriverSoftAssertion):
199
199
 
200
200
  @logger_for_loading_page
201
201
  def get_url(self, url, cleanup=True):
202
+ log.info(f'Open Page: {url}')
202
203
  self.driver.get(url)
203
204
  if cleanup:
204
205
  with contextlib.suppress(WebDriverException):
@@ -272,7 +273,10 @@ class RequestTestCase(TestCase, RequestSoftAssertion):
272
273
 
273
274
  # fix display full url
274
275
  parser = urllib.parse.urlparse(url)
275
- if not response.url.startswith('http') and 'http' in parser.scheme:
276
- response.url = f'{parser.scheme}://{parser.netloc}{response.url}'
276
+ if hasattr(response, 'url') and response.url:
277
+ if not response.url.startswith('http') and 'http' in parser.scheme:
278
+ response.url = (
279
+ f'{parser.scheme}://{parser.netloc}{response.url}'
280
+ )
277
281
 
278
282
  return response
@@ -19,7 +19,7 @@ REQUIREMENTS = [
19
19
 
20
20
  setup(
21
21
  name='Promium',
22
- version='3.5.0',
22
+ version='3.5.2',
23
23
  install_requires=REQUIREMENTS,
24
24
  author='Denis Korytkin, Nataliia Guieva, '
25
25
  'Roman Zaporozhets, Vladimir Kritov, '
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