unable to view results on playwright.microsoft.com for python pytest execution

Jain, Abhishek 0 Reputation points
2024-10-20T11:12:12.7133333+00:00

using below code to run the pytest test on playwright microsoft service. Tests are running successfully however cant see the results on https://playwright.microsoft.com/.


data = {
    "os":"windows"
}
operating = json.dumps(data)
browser = p.chromium.connect(ws_endpoint=f"url/browsers?cap={operating}",
                             expose_network="<loopback>",
                             timeout=30000,
                             headers={
                                 "x-mpt-access-key": "token"
                             })
context = browser.new_context()
page = context.new_page()

results -

User's image

Note -

When I run the test developed in pytest using plawright then tests are not visible however when I use ts then results are visible

User's image

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2024-10-20T11:12:12.72+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It seems that you are experiencing issues with viewing test results on the Playwright Microsoft service when using Python's pytest. Here are a few things to consider:

    1. Service Configuration: Ensure that your service configuration is correctly set up to publish results. The configuration should allow for reporting to the Microsoft Playwright Testing service.
    2. Access Token: Verify that the access token you are using is valid and has the necessary permissions to publish results.
    3. Test Execution: When running tests with pytest, ensure that they are being executed in a manner that allows results to be captured and sent to the service. This might involve specific configurations or commands that differ from TypeScript executions.
    4. Reporting Feature: Make sure that the reporting feature is enabled for your workspace. You can check this in the service settings.
    5. Network Configuration: Since you are using the expose_network option, ensure that it is correctly configured to allow the necessary network traffic for reporting.

    If you continue to face issues, consider checking the documentation for any specific requirements or troubleshooting steps related to Python pytest executions.


    References:

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.