qase-python-commons 3.1.8__tar.gz → 3.1.9__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.

Potentially problematic release.


This version of qase-python-commons might be problematic. Click here for more details.

Files changed (46) hide show
  1. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/PKG-INFO +1 -1
  2. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/pyproject.toml +1 -1
  3. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/client/api_v1_client.py +14 -0
  4. qase_python_commons-3.1.9/src/qase/commons/models/config/framework.py +63 -0
  5. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase_python_commons.egg-info/PKG-INFO +1 -1
  6. qase_python_commons-3.1.8/src/qase/commons/models/config/framework.py +0 -19
  7. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/README.md +0 -0
  8. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/setup.cfg +0 -0
  9. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/__init__.py +0 -0
  10. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/client/api_v2_client.py +0 -0
  11. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/client/base_api_client.py +0 -0
  12. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/config.py +0 -0
  13. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/exceptions/reporter.py +0 -0
  14. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/loader.py +0 -0
  15. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/logger.py +0 -0
  16. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/__init__.py +0 -0
  17. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/attachment.py +0 -0
  18. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/basemodel.py +0 -0
  19. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/config/api.py +0 -0
  20. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/config/batch.py +0 -0
  21. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/config/connection.py +0 -0
  22. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/config/plan.py +0 -0
  23. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/config/qaseconfig.py +0 -0
  24. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/config/report.py +0 -0
  25. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/config/run.py +0 -0
  26. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/config/testops.py +0 -0
  27. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/relation.py +0 -0
  28. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/result.py +0 -0
  29. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/run.py +0 -0
  30. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/runtime.py +0 -0
  31. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/step.py +0 -0
  32. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/models/suite.py +0 -0
  33. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/profilers/__init__.py +0 -0
  34. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/profilers/db.py +0 -0
  35. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/profilers/network.py +0 -0
  36. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/profilers/sleep.py +0 -0
  37. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/reporters/__init__.py +0 -0
  38. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/reporters/core.py +0 -0
  39. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/reporters/report.py +0 -0
  40. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/reporters/testops.py +0 -0
  41. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/utils.py +0 -0
  42. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase/commons/validators/base.py +0 -0
  43. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase_python_commons.egg-info/SOURCES.txt +0 -0
  44. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase_python_commons.egg-info/dependency_links.txt +0 -0
  45. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase_python_commons.egg-info/requires.txt +0 -0
  46. {qase_python_commons-3.1.8 → qase_python_commons-3.1.9}/src/qase_python_commons.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qase-python-commons
3
- Version: 3.1.8
3
+ Version: 3.1.9
4
4
  Summary: A library for Qase TestOps and Qase Report
5
5
  Author-email: Qase Team <support@qase.io>
6
6
  Project-URL: Homepage, https://github.com/qase-tms/qase-python/tree/master/qase-python-commons
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qase-python-commons"
7
- version = "3.1.8"
7
+ version = "3.1.9"
8
8
  description = "A library for Qase TestOps and Qase Report"
9
9
  readme = "README.md"
10
10
  authors = [{name = "Qase Team", email = "support@qase.io"}]
@@ -8,6 +8,7 @@ from .. import Logger
8
8
  from .base_api_client import BaseApiClient
9
9
  from ..exceptions.reporter import ReporterException
10
10
  from ..models import Attachment, Result, Step
11
+ from ..models.config.framework import Video, Trace
11
12
  from ..models.config.qaseconfig import QaseConfig
12
13
  from ..models.step import StepType
13
14
 
@@ -137,6 +138,8 @@ class ApiV1Client(BaseApiClient):
137
138
  attached = []
138
139
  if result.attachments:
139
140
  for attachment in result.attachments:
141
+ if self.__should_skip_attachment(attachment, result):
142
+ continue
140
143
  attach_id = self._upload_attachment(project_code, attachment)
141
144
  if attach_id:
142
145
  attached.extend(attach_id)
@@ -278,3 +281,14 @@ class ApiV1Client(BaseApiClient):
278
281
  self.__authors[author] = authors.result.entities[0].author_id
279
282
 
280
283
  return authors.result.entities[0].author_id
284
+
285
+ def __should_skip_attachment(self, attachment, result):
286
+ if (self.config.framework.playwright.video == Video.failed and
287
+ result.execution.status != 'failed' and
288
+ attachment.file_name == 'video.webm'):
289
+ return True
290
+ if (self.config.framework.playwright.trace == Trace.failed and
291
+ result.execution.status != 'failed' and
292
+ attachment.file_name == 'trace.zip'):
293
+ return True
294
+ return False
@@ -0,0 +1,63 @@
1
+ from enum import Enum
2
+ from typing import Type, Union
3
+
4
+ from ..basemodel import BaseModel
5
+ from ... import QaseUtils
6
+
7
+
8
+ class Video(Enum):
9
+ off = "off"
10
+ on = "on"
11
+ failed = "retain-on-failure"
12
+
13
+
14
+ class Trace(Enum):
15
+ off = "off"
16
+ on = "on"
17
+ failed = "retain-on-failure"
18
+
19
+
20
+ class PytestConfig(BaseModel):
21
+ capture_logs: bool = None
22
+
23
+ def __init__(self):
24
+ self.capture_logs = False
25
+
26
+ def set_capture_logs(self, capture_logs):
27
+ self.capture_logs = QaseUtils.parse_bool(capture_logs)
28
+
29
+
30
+ class PlaywrightConfig(BaseModel):
31
+ output_dir: str = None
32
+ video: Video = None
33
+ trace: Trace = None
34
+
35
+ def __init__(self):
36
+ self.output_dir = "test-results"
37
+ self.video = Video.off
38
+ self.trace = Trace.off
39
+
40
+ def set_output_dir(self, output_dir: str):
41
+ self.output_dir = output_dir
42
+
43
+ def set_video(self, value: str):
44
+ self.video = self.__set_mode(Video, value)
45
+
46
+ def set_trace(self, value: str):
47
+ self.trace = self.__set_mode(Trace, value)
48
+
49
+ @staticmethod
50
+ def __set_mode(enum_class: Type[Union[Video, Trace]], value: str):
51
+ for mode in enum_class:
52
+ if mode.value == value:
53
+ return mode
54
+ return None
55
+
56
+
57
+ class Framework(BaseModel):
58
+ pytest: PytestConfig = None
59
+ playwright: PlaywrightConfig = None
60
+
61
+ def __init__(self):
62
+ self.pytest = PytestConfig()
63
+ self.playwright = PlaywrightConfig()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qase-python-commons
3
- Version: 3.1.8
3
+ Version: 3.1.9
4
4
  Summary: A library for Qase TestOps and Qase Report
5
5
  Author-email: Qase Team <support@qase.io>
6
6
  Project-URL: Homepage, https://github.com/qase-tms/qase-python/tree/master/qase-python-commons
@@ -1,19 +0,0 @@
1
- from ..basemodel import BaseModel
2
- from ... import QaseUtils
3
-
4
-
5
- class PytestConfig(BaseModel):
6
- capture_logs: bool = None
7
-
8
- def __init__(self):
9
- self.capture_logs = False
10
-
11
- def set_capture_logs(self, capture_logs):
12
- self.capture_logs = QaseUtils.parse_bool(capture_logs)
13
-
14
-
15
- class Framework(BaseModel):
16
- pytest: PytestConfig = None
17
-
18
- def __init__(self):
19
- self.pytest = PytestConfig()