Promium 3.4.3__tar.gz → 3.5.0__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.4.3 → Promium-3.5.0}/PKG-INFO +1 -1
  2. {Promium-3.4.3 → Promium-3.5.0}/Promium.egg-info/PKG-INFO +1 -1
  3. {Promium-3.4.3 → Promium-3.5.0}/promium/common.py +43 -38
  4. {Promium-3.4.3 → Promium-3.5.0}/setup.py +1 -1
  5. {Promium-3.4.3 → Promium-3.5.0}/LICENSE +0 -0
  6. {Promium-3.4.3 → Promium-3.5.0}/Promium.egg-info/SOURCES.txt +0 -0
  7. {Promium-3.4.3 → Promium-3.5.0}/Promium.egg-info/dependency_links.txt +0 -0
  8. {Promium-3.4.3 → Promium-3.5.0}/Promium.egg-info/entry_points.txt +0 -0
  9. {Promium-3.4.3 → Promium-3.5.0}/Promium.egg-info/requires.txt +0 -0
  10. {Promium-3.4.3 → Promium-3.5.0}/Promium.egg-info/top_level.txt +0 -0
  11. {Promium-3.4.3 → Promium-3.5.0}/README.rst +0 -0
  12. {Promium-3.4.3 → Promium-3.5.0}/doc/__init__.py +0 -0
  13. {Promium-3.4.3 → Promium-3.5.0}/doc/conf.py +0 -0
  14. {Promium-3.4.3 → Promium-3.5.0}/promium/__init__.py +0 -0
  15. {Promium-3.4.3 → Promium-3.5.0}/promium/assertions.py +0 -0
  16. {Promium-3.4.3 → Promium-3.5.0}/promium/base.py +0 -0
  17. {Promium-3.4.3 → Promium-3.5.0}/promium/browsers.py +0 -0
  18. {Promium-3.4.3 → Promium-3.5.0}/promium/device_config.py +0 -0
  19. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/__init__.py +0 -0
  20. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/checkbox.py +0 -0
  21. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/drop_downs.py +0 -0
  22. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/frame.py +0 -0
  23. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/input_field.py +0 -0
  24. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/link.py +0 -0
  25. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/multiselect_listbox.py +0 -0
  26. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/radio_button.py +0 -0
  27. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/textarea_field.py +0 -0
  28. {Promium-3.4.3 → Promium-3.5.0}/promium/elements/upload_button.py +0 -0
  29. {Promium-3.4.3 → Promium-3.5.0}/promium/exceptions.py +0 -0
  30. {Promium-3.4.3 → Promium-3.5.0}/promium/expected_conditions.py +0 -0
  31. {Promium-3.4.3 → Promium-3.5.0}/promium/helpers.py +0 -0
  32. {Promium-3.4.3 → Promium-3.5.0}/promium/logger.py +0 -0
  33. {Promium-3.4.3 → Promium-3.5.0}/promium/plugin.py +0 -0
  34. {Promium-3.4.3 → Promium-3.5.0}/promium/support/__init__.py +0 -0
  35. {Promium-3.4.3 → Promium-3.5.0}/promium/support/settings.py +0 -0
  36. {Promium-3.4.3 → Promium-3.5.0}/promium/test_case.py +0 -0
  37. {Promium-3.4.3 → Promium-3.5.0}/promium/waits.py +0 -0
  38. {Promium-3.4.3 → Promium-3.5.0}/setup.cfg +0 -0
  39. {Promium-3.4.3 → Promium-3.5.0}/tests/__init__.py +0 -0
  40. {Promium-3.4.3 → Promium-3.5.0}/tests/config.py +0 -0
  41. {Promium-3.4.3 → Promium-3.5.0}/tests/conftest.py +0 -0
  42. {Promium-3.4.3 → Promium-3.5.0}/tests/pages/__init__.py +0 -0
  43. {Promium-3.4.3 → Promium-3.5.0}/tests/pages/catalog_404_page.py +0 -0
  44. {Promium-3.4.3 → Promium-3.5.0}/tests/pages/catalog_gallery_page.py +0 -0
  45. {Promium-3.4.3 → Promium-3.5.0}/tests/settings/__init__.py +0 -0
  46. {Promium-3.4.3 → Promium-3.5.0}/tests/settings/test_base.py +0 -0
  47. {Promium-3.4.3 → Promium-3.5.0}/tests/settings/test_chrome.py +0 -0
  48. {Promium-3.4.3 → Promium-3.5.0}/tests/settings/test_edge.py +0 -0
  49. {Promium-3.4.3 → Promium-3.5.0}/tests/settings/test_firefox.py +0 -0
  50. {Promium-3.4.3 → Promium-3.5.0}/tests/settings/test_ie.py +0 -0
  51. {Promium-3.4.3 → Promium-3.5.0}/tests/settings/test_opera.py +0 -0
  52. {Promium-3.4.3 → Promium-3.5.0}/tests/test_catalog_404.py +0 -0
  53. {Promium-3.4.3 → Promium-3.5.0}/tests/test_catalog_gallery.py +0 -0
  54. {Promium-3.4.3 → Promium-3.5.0}/tests/test_enviroment.py +0 -0
  55. {Promium-3.4.3 → Promium-3.5.0}/tests/test_requests.py +0 -0
  56. {Promium-3.4.3 → Promium-3.5.0}/tests/test_soft_asserts.py +0 -0
  57. {Promium-3.4.3 → Promium-3.5.0}/tests/test_waits.py +0 -0
  58. {Promium-3.4.3 → Promium-3.5.0}/tests/urls.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Promium
3
- Version: 3.4.3
3
+ Version: 3.5.0
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.4.3
3
+ Version: 3.5.0
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,8 @@
1
1
  import base64
2
2
  import os
3
3
  import datetime
4
+
5
+ import allure
4
6
  import urllib3
5
7
  import json
6
8
  import time
@@ -249,17 +251,16 @@ def delete_element_from_dom(driver, element):
249
251
  def find_network_log(
250
252
  driver, find_mask, find_status=200, timeout=5, find_type=None
251
253
  ):
252
- """ find xrh response and requset data from browser network logs
254
+ """ find xrh response and request data from browser network logs
253
255
  :param driver: selenium driver
254
256
  :param find_mask: find word in request url
255
257
  :param find_status: find response with this status
256
258
  :param timeout: tries
257
259
  :param find_type: check type request in network (example find_type='Fetch')
258
- :return: {response, data, body} or None
260
+ :return: [{response, data, body}, {response, data, body}] or []
259
261
  """
260
- found_logs = []
261
-
262
262
  def get_log(request_mask):
263
+ found_requests = []
263
264
  for performance_log in driver.get_log('performance'):
264
265
  # only response logs
265
266
  if (
@@ -270,49 +271,46 @@ def find_network_log(
270
271
  if not json_log['params'].get('response'):
271
272
  continue
272
273
  response = json_log['params']['response']
273
- found_logs.append({
274
- 'url': response.get('url'),
275
- 'status': (
276
- f"{response['status']} - {response['statusText']}"
274
+ if (
275
+ response['status'] == find_status and (
276
+ not find_type or json_log['params']['type'] == find_type
277
277
  )
278
- })
279
- if response['status'] == find_status and (
280
- not find_type or
281
- json_log['params']['type'] == find_type):
282
- return json_log
278
+ ):
279
+ found_requests.append(json_log)
280
+ return found_requests
283
281
 
284
282
  while timeout >= 0:
285
283
  xhr_log = get_log(find_mask)
286
284
  if xhr_log:
287
- requestId = xhr_log['params']['requestId'] # noqa: N806
288
- response = xhr_log['params']['response']
289
285
  break
290
286
  time.sleep(0.5)
291
287
  timeout -= 1
292
288
 
293
- try:
294
- request_data = driver.execute_cdp_cmd(
295
- 'Network.getRequestPostData', {'requestId': requestId}
296
- )
297
- request_data = json.loads(request_data['postData'])
298
- except Exception:
299
- request_data = None
300
-
301
- try:
302
- response_body = driver.execute_cdp_cmd(
303
- 'Network.getResponseBody', {'requestId': requestId}
289
+ result_all_logs = []
290
+ for network_log in xhr_log:
291
+ requestId = network_log['params']['requestId'] # noqa: N806
292
+ response = network_log['params']['response']
293
+ try:
294
+ request_data = driver.execute_cdp_cmd(
295
+ 'Network.getRequestPostData', {'requestId': requestId}
296
+ )
297
+ request_data = json.loads(request_data['postData'])
298
+ except Exception:
299
+ request_data = None
300
+
301
+ try:
302
+ response_body = driver.execute_cdp_cmd(
303
+ 'Network.getResponseBody', {'requestId': requestId}
304
+ )
305
+ response_body = json.loads(response_body['body'])
306
+ except Exception:
307
+ response_body = None
308
+
309
+ log.info(
310
+ f"[XHR Logs]: find by mask: '{find_mask}' -> {response.get('url')} "
311
+ f"{response.get('status')} - {response.get('statusText')}"
304
312
  )
305
- response_body = json.loads(response_body['body'])
306
- except Exception:
307
- response_body = None
308
-
309
- log.info(
310
- f"[XHR Logs]: find by mask: '{find_mask}', result: {found_logs}, "
311
- f"request_data: {request_data}, response_body: {response_body},"
312
- )
313
-
314
- if xhr_log:
315
- return {
313
+ result_all_logs.append({
316
314
  'response': {
317
315
  'url': response.get('url'),
318
316
  'status': response.get('status'),
@@ -320,4 +318,11 @@ def find_network_log(
320
318
  },
321
319
  'data': request_data,
322
320
  'body': response_body,
323
- }
321
+ })
322
+
323
+ allure.attach(
324
+ name=f"[XHR log] '{find_mask}', status:{find_status}, type:{find_type}",
325
+ body=json.dumps(result_all_logs, indent=4, ensure_ascii=False),
326
+ attachment_type=allure.attachment_type.JSON,
327
+ )
328
+ return result_all_logs
@@ -19,7 +19,7 @@ REQUIREMENTS = [
19
19
 
20
20
  setup(
21
21
  name='Promium',
22
- version='3.4.3',
22
+ version='3.5.0',
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
File without changes