Skip to content

Commit

Permalink
feature: improve video handling in Playwright
Browse files Browse the repository at this point in the history
If a video is attached to the result, it will be added as an attachment. You can configure this functionality using the "video" parameter:

- `--video on` - add a video to each test
- `--video retain-on-failure` - add a video to each filed test
  • Loading branch information
gibiw committed Sep 27, 2024
1 parent 4bbf124 commit 16a20c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
14 changes: 12 additions & 2 deletions qase-pytest/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# qase-pytest 6.1.3

## What's new

If a video is attached to the result, it will be added as an attachment.
You can configure this functionality using the "video" parameter:

- `--video on` - add a video to each test
- `--video retain-on-failure` - add a video to each filed test

# qase-pytest 6.1.2

## What's new
Expand All @@ -15,7 +25,7 @@ Minor release that includes all changes from beta versions 6.1.1b.

## What's new

Fixed an issue with `network` profiler.
Fixed an issue with `network` profiler.

# qase-pytest 6.1.1b4

Expand All @@ -24,7 +34,7 @@ Fixed an issue with `network` profiler.
Fixed an issue with parameters like this:

```python
@pytest.mark.parametrize(argnames="foo", argvalues=["bar","baz"])
@pytest.mark.parametrize(argnames="foo", argvalues=["bar", "baz"])
```

The error was:
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.2"
version = "6.1.3"
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.5",
"qase-python-commons~=3.1.8",
"pytest>=7.4.4",
"filelock~=3.12.2",
"more_itertools",
Expand Down
3 changes: 1 addition & 2 deletions qase-pytest/src/qase/pytest/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ def _attach_logs():
if self.reporter.config.framework.pytest.capture_logs and report.when == "call":
_attach_logs()

# Check if the test failed
if report.failed and report.when == "call":
if report.when == "call":
# Attach the video to the test result
if hasattr(item, 'funcargs') and 'page' in item.funcargs:
video = item.funcargs['page'].video
Expand Down

0 comments on commit 16a20c2

Please sign in to comment.