For Node.js it’s mentioned option ‘retain-on-failure’ (https://playwright.dev/docs/videos) to preserve only videos for failed tests. Nothing similar for the Python. How can it be solved (delete videos for passed tests)? Thanks
import pytest
from playwright.sync_api import sync_playwright
@pytest.fixture(scope="module")
def browser(headless):
with sync_playwright() as p:
browser = p.chromium.launch(headless=headless)
yield browser
browser.close()
@pytest.fixture
def context(browser):
context = browser.new_context(
record_video_dir="reports/",
record_video_size={"width": 1024, "height": 768},
)
yield context
context.close()
@pytest.fixture
def page(context):
page = context.new_page()
yield page
page.close()