Skip to content

[BUG] Tracing does not work with playwright.request.newcontext() #137

Description

@jnjgomez10

Context:
I am using playwright to test REST API endpoints.
I do not see trace.zip after I run pytest --tracing=on.

Code Snippet

Simple test script

import os
from typing import Generator

import pytest
from playwright.sync_api import Playwright, APIRequestContext


@pytest.fixture(scope="session")
def api_request_context(
    playwright: Playwright,
) -> Generator[APIRequestContext, None, None]:
    request_context = playwright.request.new_context(
        base_url="https://api.publicapis.org",
        ignore_https_errors=True
    )
    yield request_context
    request_context.dispose()

def test_should_create_bug_report(api_request_context: APIRequestContext) -> None:
    response = api_request_context.get("/entries")
    assert response.ok

Describe the bug

pytest --tracing=on test_mytest.py does not produce trace.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions