Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Ability to add custom annotations to trace files #30433

Closed
Donaim opened this issue Apr 19, 2024 · 5 comments
Closed

[Feature]: Ability to add custom annotations to trace files #30433

Donaim opened this issue Apr 19, 2024 · 5 comments

Comments

@Donaim
Copy link

Donaim commented Apr 19, 2024

馃殌 Feature Request

I would like to propose a feature for the Playwright tracing facility that allows users to add custom annotations (free text) to trace files. Currently, Playwright's tracing capabilities automatically record actions like page.navigate, page.click, etc. While this is incredibly useful, the ability to insert custom annotations would enhance the trace's usefulness and readability, especially for complex scenarios.

Example

with page.annotate("Login test sequence"):
    page.locator("input[name='username']").fill("testuser")
    page.locator("input[name='password']").fill("password")
    page.locator("text='Log in'").click()

Motivation

In many testing and debugging scenarios, it's beneficial to have context-specific information that explains why certain actions are taken or to mark important checkpoints in the trace. Custom annotations can serve as explanatory notes or markers within the trace file, making it easier to understand the flow, especially when sharing these traces with other team members.

For instance, a test might involve a series of steps with conditional logic, and being able to annotate the trace with information like "Starting Section A tests" or "Conditional logic X triggered" would be valuable.

@mxschmitt mxschmitt transferred this issue from microsoft/playwright-python Apr 19, 2024
@Donaim
Copy link
Author

Donaim commented Apr 19, 2024

Feature originally proposed here: #28206

That issue's log also suggests that the only way to have custom annotations currently is to use javascripts' test framework.
Nevertheless, that means that in Javascript we can have them, but not in Python.

@yury-s
Copy link
Member

yury-s commented Apr 19, 2024

That issue's log also suggests that the only way to have custom annotations currently is to use javascripts' test framework.
Nevertheless, that means that in Javascript we can have them, but not in Python.

Is your request about particular non-JS Playwright versions or about support for such annotations in the playwright js library (as opposed to Playwright Test where you can already achieve it)?

@Donaim
Copy link
Author

Donaim commented Apr 19, 2024

@yury-s it is about particular non-JS Playwright, specifically playwright-python.

@DetachHead
Copy link
Contributor

this has been raised on playwright-python: microsoft/playwright-python#1949

@yury-s
Copy link
Member

yury-s commented Apr 22, 2024

Folding into microsoft/playwright-python#1949

@yury-s yury-s closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants