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.
- {Promium-3.5.0 → Promium-3.5.2}/PKG-INFO +1 -1
- {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/PKG-INFO +1 -1
- {Promium-3.5.0 → Promium-3.5.2}/promium/base.py +13 -12
- {Promium-3.5.0 → Promium-3.5.2}/promium/test_case.py +6 -2
- {Promium-3.5.0 → Promium-3.5.2}/setup.py +1 -1
- {Promium-3.5.0 → Promium-3.5.2}/LICENSE +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/SOURCES.txt +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/dependency_links.txt +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/entry_points.txt +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/requires.txt +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/Promium.egg-info/top_level.txt +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/README.rst +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/doc/__init__.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/doc/conf.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/__init__.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/assertions.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/browsers.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/common.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/device_config.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/__init__.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/checkbox.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/drop_downs.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/frame.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/input_field.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/link.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/multiselect_listbox.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/radio_button.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/textarea_field.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/elements/upload_button.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/exceptions.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/expected_conditions.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/helpers.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/logger.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/plugin.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/support/__init__.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/support/settings.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/promium/waits.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/setup.cfg +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/__init__.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/config.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/conftest.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/pages/__init__.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/pages/catalog_404_page.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/pages/catalog_gallery_page.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/settings/__init__.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_base.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_chrome.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_edge.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_firefox.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_ie.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/settings/test_opera.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/test_catalog_404.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/test_catalog_gallery.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/test_enviroment.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/test_requests.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/test_soft_asserts.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/test_waits.py +0 -0
- {Promium-3.5.0 → Promium-3.5.2}/tests/urls.py +0 -0
|
@@ -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
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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(
|
|
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
|
|
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=
|
|
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
|
|
276
|
-
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
|
|
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
|
|
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
|