Open Egzekk opened 1 day ago
@Egzekk Hi!
Steps to solve the problem:
qase-pytest
to 6.1.3 versionconftest.py
with this code:
import pytest
@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 }
- add `--video on` or `--video retain-on-failure` parameter
The issue has been resolved. For those encountering this problem, I recommend passing "record_video_dir"
as browser_context_args["record_video_dir"]
. This approach preserves the original naming conventions after the test and creates a default folder structure for each test. If you specify any other path, it will not follow the same naming convention or folder structure, resulting in a file with a random string name.
After further testing, I've encountered an issue with the suggested configuration:
@pytest.fixture(scope="function")
def browser_context_args(browser_context_args):
return {
**browser_context_args,
"record_video_dir": "results/playwright", # Directory for saving videos
"record_video_size": {"width": 1280, "height": 720}, # Video resolution
}
When using the output=results/playwright
flag in pytest.ini
, an additional video file with a random string name is created next to the original one, but outside any folders, as shown below:
Expected behavior:
Without the output=results/playwright
flag, it outputs videos with random names and no folder structure, which is also problematic.
Managing many tests and videos becomes cumbersome due to this duplication and disorganization. Could you please check it and adjust?
If we use
--video on
option or--video retain-on-failure
in pytest.ini or pyproject.toml as pytest'saddopts
argument, the qase is not uploading the video correctly and is giving an error:Even if we add another option:
--output=results/playwright
it still throws an error as above.The above mentioned options are officialy supported by playwright for pytest: https://playwright.dev/python/docs/test-runners
Could you please take a look at that? It is a quite an important feature for us to have.