Fixed issues with using pytest.xfail
and the skipif
mark:
- Custom statuses did not work when using
pytest.xfail
within the test body. - The status was incorrect when using the
skipif
mark.
The ability to override statuses for tests marked with the xfail
marker has been added. By default, failed tests are
assigned the skipped
status, and passed tests are assigned the passed
status. Custom statuses can be specified by
providing the slug of the desired status in the configuration. Configuration values can be set via qase.config.json
or
environment variables:
QASE_PYTEST_XFAIL_STATUS_XFAIL
QASE_PYTEST_XFAIL_STATUS_XPASS
{ ...,
"framework": {
"pytest": {
"captureLogs": true,
+ "xfailStatus": {
+ "xfail": "skipped",
+ "xpass": "passed"
+ }
+ }
}
}
Fixed an issue with parameters:
INTERNALERROR> File "/venv/lib/python3.9/site-packages/qase/pytest/plugin.py", line 331, in _set_params
INTERNALERROR> value = str(ids[i])
INTERNALERROR> IndexError: list index out of range
Fixed an issue with suites [#296]
Support new version of qase-python-commons
Fixed an issue with the handling video and trace recording for Playwright tests. If a test was part of a class, the video and trace were not attached to the test result.
Improved the handling of videos and traces for Playwright tests.
You don't need to create a conftest.py
file anymore. The video and trace will be attached to the test result
automatically.
You can configure the video and trace recording using the following parameters:
--video on
- add a video to each test--video retain-on-failure
- add a video to each filed test--tracing on
- add a trace to each test--tracing retain-on-failure
- add a trace to each filed test--output
- the directory where the video and trace will be saved. By default, the video and trace will be saved in thetest-results
directory.
Improve handling parameters in the pytest.mark.parametrize
decorator.
If you specify the ids
parameter, the reporter will use it as value of parameter in the test case.
@pytest.mark.parametrize("enter", [enter_from_meta, enter_from_expedition, enter_from_news],
ids=["enter_from_meta", "enter_from_expedition", "enter_from_news"])
def test_enter(enter):
enter()
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
Fixed an issue with the pytest-xdist
that caused the tests to be run in parallel and completed the test run before the
results were uploaded to Qase.
Minor release that includes all changes from beta versions 6.1.1b.
Fixed an issue with network
profiler.
Fixed an issue with parameters like this:
@pytest.mark.parametrize(argnames="foo", argvalues=["bar", "baz"])
The error was:
INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/qase/pytest/plugin.py", line 79, in pytest_collection_modifyitems
INTERNALERROR> param_name, values = mark.args
INTERNALERROR> ^^^^^^^^^^^^^^^^^^
INTERNALERROR> ValueError: not enough values to unpack (expected 2, got 0)
Fix an issue with the video recording option when the test fails:
INTERNALERROR> video = item.funcargs['page'].video
INTERNALERROR> ~~~~~~~~~~~~~^^^^^^^^
INTERNALERROR> KeyError: 'page'
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:
import pytest
# Configure Playwright to record video for all tests
@pytest.fixture(scope="session")
def browser_context_args(browser_context_args):
return {
**browser_context_args,
"record_video_dir": "./videos", # Directory where videos will be saved
"record_video_size": {"width": 1280, "height": 720} # Video resolution
}
Support pytest-rerunfailures
plugin. This plugin allows you to rerun failed tests.
Each test run will be uploaded as a separate result in Qase.
Minor release that includes all changes from beta versions 6.1.0b. And also added support for group parameters.
- 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.
Fixed an issue then qase-pytest-capture-logs
parameter did not set correct value.
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-testops-batch-size" parameter, an error occurred:TypeError: '>' not supported between instances of 'str' and 'int'
Implemented a method that constructs a signature for each test result. It takes the file path, suites, qase IDs, and parameters.
Fixed the issue where the suite specified in the decorator was not displayed. Fix [#231]
Fixed the issue [#226]:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Changed the name of the complete test run parameter for CLI arguments. Fix [#160]
The first release in the 6.0.x series of the Pytest reporter.
Turn off the sleep profiler until the test data collection is completed. Now the profilers will turn off after the test is completed.