Skip to content

Commit

Permalink
fix: issue with the video uploading
Browse files Browse the repository at this point in the history
```log
INTERNALERROR>     video = item.funcargs['page'].video
INTERNALERROR>             ~~~~~~~~~~~~~^^^^^^^^
INTERNALERROR> KeyError: 'page'
```
  • Loading branch information
gibiw committed Sep 3, 2024
1 parent 34708c8 commit f627ec4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
29 changes: 22 additions & 7 deletions qase-pytest/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@

## What's new

If the video recording option is enabled and the test fails, the video will be attached to the test result when using Playwright.
Fix an issue with the video recording option when the test fails:

```log
INTERNALERROR> video = item.funcargs['page'].video
INTERNALERROR> ~~~~~~~~~~~~~^^^^^^^^
INTERNALERROR> KeyError: 'page'
```

# qase-pytest 6.1.1b2

## What's new

If the video recording option is enabled and the test fails, the video will be attached to the test result when using
Playwright.

For configuration, you should create a `conftest.py` file in the root of your project and add the following code:

```python
import pytest


# Configure Playwright to record video for all tests
@pytest.fixture(scope="session")
def browser_context_args(browser_context_args):
Expand All @@ -30,15 +44,16 @@ Each test run will be uploaded as a separate result in Qase.

## What's new

Minor release that includes all changes from beta versions 6.1.0b.
Minor release that includes all changes from beta versions 6.1.0b.
And also added support for group parameters.

# qase-pytest 6.1.0b4

## What's new

- Exclude the default parameters that are added by additional libraries and start with `__pytest`
- If you use the `testops` mode and specify a plan ID then the reporter will run the tests specified in the test plan based on their IDs.
- If you use the `testops` mode and specify a plan ID then the reporter will run the tests specified in the test plan
based on their IDs.

# qase-pytest 6.1.0b3

Expand All @@ -53,10 +68,10 @@ Fixed an issue then `qase-pytest-capture-logs` parameter did not set correct val
Fixed the following issues:

- issue with `qase-pytest-capture-logs` parameter [#234].
When using the "qase-pytest-capture-logs" parameter, an error occurred:
`pytest: error: unrecognized arguments: --qase-pytest-capture-logs=true`
- issue with `qase-testops-batch-size` parameter [#235].
When using the "qase-pytest-capture-logs" parameter, an error occurred:
`pytest: error: unrecognized arguments: --qase-pytest-capture-logs=true`

- issue with `qase-testops-batch-size` parameter [#235].
When using the "qase-testops-batch-size" parameter, an error occurred:
`TypeError: '>' not supported between instances of 'str' and 'int'`

Expand Down
4 changes: 2 additions & 2 deletions qase-pytest/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "qase-pytest"
version = "6.1.1b2"
version = "6.1.1b3"
description = "Qase Pytest Plugin for Qase TestOps and Qase Report"
readme = "README.md"
keywords = ["qase", "pytest", "plugin", "testops", "report", "qase reporting", "test observability"]
Expand All @@ -29,7 +29,7 @@ classifiers = [
]
requires-python = ">=3.7"
dependencies = [
"qase-python-commons~=3.1.1",
"qase-python-commons~=3.1.2",
"pytest>=7.4.4",
"filelock~=3.12.2",
"more_itertools",
Expand Down
11 changes: 6 additions & 5 deletions qase-pytest/src/qase/pytest/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,11 @@ def _attach_logs():
# Check if the test failed
if report.failed and report.when == "call":
# Attach the video to the test result
video = item.funcargs['page'].video
if not video:
return
self.add_attachments(video.path())
if hasattr(item, 'funcargs') and 'page' in item.funcargs:
video = item.funcargs['page'].video
if not video:
return
self.add_attachments(video.path())
else:
yield

Expand Down Expand Up @@ -258,7 +259,7 @@ def _set_relations(self, item) -> None:

def _set_fields(self, item) -> None:
# Legacy fields support
for name in ["description", "preconditions", "postconditions", "layer", "severity", "priority"]:
for name in ["description", "preconditions", "postconditions", "layer", "severity", "priority", "suite"]:
try:
self.runtime.result.add_field(Field(name, item.get_closest_marker("qase_" + name).kwargs.get(name)))
except:
Expand Down

0 comments on commit f627ec4

Please sign in to comment.