Promium 3.3.25__tar.gz → 3.3.26__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.3.25 → Promium-3.3.26}/PKG-INFO +2 -2
- {Promium-3.3.25 → Promium-3.3.26}/Promium.egg-info/PKG-INFO +2 -2
- {Promium-3.3.25 → Promium-3.3.26}/promium/base.py +1 -1
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/link.py +12 -13
- {Promium-3.3.25 → Promium-3.3.26}/promium/plugin.py +0 -11
- {Promium-3.3.25 → Promium-3.3.26}/promium/test_case.py +23 -10
- {Promium-3.3.25 → Promium-3.3.26}/setup.py +2 -2
- {Promium-3.3.25 → Promium-3.3.26}/tests/test_catalog_404.py +2 -3
- {Promium-3.3.25 → Promium-3.3.26}/LICENSE +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/Promium.egg-info/SOURCES.txt +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/Promium.egg-info/dependency_links.txt +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/Promium.egg-info/entry_points.txt +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/Promium.egg-info/requires.txt +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/Promium.egg-info/top_level.txt +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/README.rst +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/doc/__init__.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/doc/conf.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/__init__.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/assertions.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/browsers.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/common.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/device_config.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/__init__.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/checkbox.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/drop_downs.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/frame.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/input_field.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/multiselect_listbox.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/radio_button.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/textarea_field.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/elements/upload_button.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/exceptions.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/expected_conditions.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/helpers.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/logger.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/support/__init__.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/support/settings.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/promium/waits.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/setup.cfg +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/__init__.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/config.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/conftest.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/pages/__init__.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/pages/catalog_404_page.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/pages/catalog_gallery_page.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/settings/__init__.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/settings/test_base.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/settings/test_chrome.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/settings/test_edge.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/settings/test_firefox.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/settings/test_ie.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/settings/test_opera.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/test_catalog_gallery.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/test_enviroment.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/test_requests.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/test_soft_asserts.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/test_waits.py +0 -0
- {Promium-3.3.25 → Promium-3.3.26}/tests/urls.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Promium
|
|
3
|
-
Version: 3.3.
|
|
3
|
+
Version: 3.3.26
|
|
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
|
|
7
7
|
Project-URL: Documentation, https://none
|
|
8
8
|
Keywords: Testing UI,Selenium,PageObject,Selenium wrapper
|
|
9
9
|
Platform: linux
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
11
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
12
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
13
13
|
Classifier: Topic :: Software Development :: Testing
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Promium
|
|
3
|
-
Version: 3.3.
|
|
3
|
+
Version: 3.3.26
|
|
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
|
|
7
7
|
Project-URL: Documentation, https://none
|
|
8
8
|
Keywords: Testing UI,Selenium,PageObject,Selenium wrapper
|
|
9
9
|
Platform: linux
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
11
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
12
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
13
13
|
Classifier: Topic :: Software Development :: Testing
|
|
@@ -315,7 +315,7 @@ class Collection(Base, Sequence):
|
|
|
315
315
|
def is_not_empty(self):
|
|
316
316
|
return not self.is_empty()
|
|
317
317
|
|
|
318
|
-
def random_choice(self):
|
|
318
|
+
def random_choice(self) -> WebElement:
|
|
319
319
|
elements = self.wait_not_empty()
|
|
320
320
|
index = random.randint(0, len(elements) - 1)
|
|
321
321
|
return self.get_item(index)
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
import requests
|
|
3
|
-
|
|
4
|
-
from requests.adapters import HTTPAdapter
|
|
5
|
-
from requests.packages.urllib3.util.retry import Retry
|
|
3
|
+
import logging
|
|
6
4
|
|
|
7
5
|
from promium.base import Element
|
|
8
6
|
from promium.helpers import ParseUrl
|
|
9
7
|
|
|
10
8
|
|
|
9
|
+
log = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
11
12
|
class Link(Element):
|
|
12
13
|
|
|
13
14
|
@property
|
|
@@ -32,19 +33,17 @@ class Link(Element):
|
|
|
32
33
|
|
|
33
34
|
@property
|
|
34
35
|
def response(self):
|
|
35
|
-
retry_strategy = Retry(
|
|
36
|
-
total=3,
|
|
37
|
-
backoff_factor=0.2,
|
|
38
|
-
status_forcelist=[502, 503, 504],
|
|
39
|
-
method_whitelist=["GET"]
|
|
40
|
-
)
|
|
41
|
-
adapter = HTTPAdapter(max_retries=retry_strategy)
|
|
42
36
|
session = requests.Session()
|
|
43
37
|
for cookie in self.driver.get_cookies():
|
|
44
38
|
session.cookies.set(cookie['name'], cookie['value'])
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
for i in range(1, 3):
|
|
40
|
+
r = session.get(self.href, verify=False, timeout=10)
|
|
41
|
+
if r.status_code in [502, 503, 504] and r.request.method == 'GET':
|
|
42
|
+
log.warning(f'[Request Retry]: attempt:{i}, status: {r.status}')
|
|
43
|
+
else:
|
|
44
|
+
break
|
|
45
|
+
|
|
46
|
+
return r
|
|
48
47
|
|
|
49
48
|
@property
|
|
50
49
|
def get_status_code(self):
|
|
@@ -7,9 +7,6 @@ from collections import namedtuple
|
|
|
7
7
|
import pytest
|
|
8
8
|
import allure
|
|
9
9
|
|
|
10
|
-
from requests.adapters import HTTPAdapter
|
|
11
|
-
from requests.packages.urllib3.util.retry import Retry
|
|
12
|
-
|
|
13
10
|
from selenium.common.exceptions import WebDriverException
|
|
14
11
|
from promium.test_case import create_driver
|
|
15
12
|
from promium.common import upload_screenshot
|
|
@@ -147,14 +144,6 @@ def request_init(request):
|
|
|
147
144
|
)
|
|
148
145
|
|
|
149
146
|
session = requests.session()
|
|
150
|
-
retry_strategy = Retry(
|
|
151
|
-
total=3,
|
|
152
|
-
status_forcelist=[502, 503, 504],
|
|
153
|
-
method_whitelist=["POST", "GET"]
|
|
154
|
-
)
|
|
155
|
-
adapter = HTTPAdapter(max_retries=retry_strategy)
|
|
156
|
-
session.mount("https://", adapter)
|
|
157
|
-
session.mount("http://", adapter)
|
|
158
147
|
session.url = (
|
|
159
148
|
'Use self.get_response(url) for request tests or '
|
|
160
149
|
'util methods for api tests!'
|
|
@@ -210,14 +210,27 @@ class RequestTestCase(TestCase, RequestSoftAssertion):
|
|
|
210
210
|
request_cookies = {'xrequestid': self.xrequestid}
|
|
211
211
|
if cookies:
|
|
212
212
|
request_cookies.update(cookies)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
213
|
+
|
|
214
|
+
for i in range(1, 3):
|
|
215
|
+
response = self.session.request(
|
|
216
|
+
method=method,
|
|
217
|
+
url=url,
|
|
218
|
+
timeout=timeout,
|
|
219
|
+
verify=False,
|
|
220
|
+
cookies=request_cookies,
|
|
221
|
+
hooks=dict(response=request_logging),
|
|
222
|
+
**kwargs,
|
|
223
|
+
)
|
|
224
|
+
self.session.status_code = response.status_code
|
|
225
|
+
if (
|
|
226
|
+
response.status_code in [502, 503, 504] and
|
|
227
|
+
response.request.method in ["POST", "GET"]
|
|
228
|
+
):
|
|
229
|
+
log.warning(
|
|
230
|
+
f'[Request Retry]: attempt:{i}, '
|
|
231
|
+
f'status: {response.status_code}'
|
|
232
|
+
)
|
|
233
|
+
else:
|
|
234
|
+
break
|
|
235
|
+
|
|
223
236
|
return response
|
|
@@ -19,7 +19,7 @@ REQUIREMENTS = [
|
|
|
19
19
|
|
|
20
20
|
setup(
|
|
21
21
|
name='Promium',
|
|
22
|
-
version='3.3.
|
|
22
|
+
version='3.3.26',
|
|
23
23
|
install_requires=REQUIREMENTS,
|
|
24
24
|
author='Denis Korytkin, Nataliia Guieva, '
|
|
25
25
|
'Roman Zaporozhets, Vladimir Kritov, '
|
|
@@ -36,7 +36,7 @@ setup(
|
|
|
36
36
|
entry_points={'pytest11': ['promium = promium.plugin']},
|
|
37
37
|
python_requires='>=3.10, <4',
|
|
38
38
|
classifiers=[
|
|
39
|
-
'Programming Language :: Python :: 3.
|
|
39
|
+
'Programming Language :: Python :: 3.12',
|
|
40
40
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
41
41
|
'Topic :: Software Development :: Libraries :: Application Frameworks',
|
|
42
42
|
'Topic :: Software Development :: Testing',
|
|
@@ -20,10 +20,9 @@ class Test404CatalogPage(WebDriverTestCase):
|
|
|
20
20
|
'Оо! Страница не найдена',
|
|
21
21
|
'Не правильно указан основной title на странице 404.'
|
|
22
22
|
)
|
|
23
|
-
self.
|
|
23
|
+
self.soft_assert_in(
|
|
24
|
+
'Похоже такой страницы больше нет',
|
|
24
25
|
catalog_404_page.suggest_404_title.text,
|
|
25
|
-
'Похоже такой страницы больше нет, либо произошла какая-то ошибка, '
|
|
26
|
-
'попробуйте обновить страницу либо поискать что-то еще',
|
|
27
26
|
'Не правильно указан suggest title на странице 404.'
|
|
28
27
|
)
|
|
29
28
|
|
|
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
|