-
-
Notifications
You must be signed in to change notification settings - Fork 36
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open Playwright trace from HTML report without downloading #103
Comments
Interesting idea, should think about it. There are two questions:
|
Hi @vitalets, we should have a look at how playwright team are making the remote view traces available directly within their html report. I had a look in TeamCity on our side and this is what I see: The view option in the playwright's original HTML reporter generates the following link:
If I copy and paste this link in a new browser tab, the traces are opened directly within that tab. Just for your information the only thing that I am configuring in TeamCity is to point to the path where the html playwright report is being generated. If I open in a browser tab only the second part of the above link it will just download the zip file -> So it seems that they do not use in their html report view the So from all above observations let me try to answer the questions:
|
@vitalets This is how the html traces link looks for localhost
|
Nice investigation. I didn't realize that Playwright HTML report also acts as trace viewer. export function generateTraceUrl(traces: TestAttachment[]) {
return `trace/index.html?${traces.map((a, i) => `trace=${new URL(a.path!, window.location.href)}`).join('&')}`;
} What we can do for Cucumber reports:
Another option is to embed Playwright trace viewer into Cucumber report somehow. One more thing I've noticed - traceviewer works only on Lets think more about it. |
Embeding the Playwright trace-viewer into Cucumber report sounds great. As you said, currently you can not open the traces from the playwright html report locally, it gives the above error, but I don't think this is a stopper, because locally most of the users are using directly In my case, because of company restrictions, the Maybe we can create a feature ticket on playwright side to allow also |
adding a flag to create an "All-in-one" tracer zip would also be amazing! :) |
@arieluchka-bse Just to clarify, under 'all-in-one' tracer you mean Cucumber report bound with tracer, right? |
hi, apologies if it's the wrong repo to comment on. from what i saw, in NodeJS there is an option to set the "reporter" to html, and all the test results + traces, can be opened locally with the generated reporter (so no need to navigate to the site. i wanted to implement something similar to what's showing here, with providing links to trace.zips, but the author of this achived it with setting the reporter to html (tutorial). just wish there was something like this for python, that will allow viewing traces, just by opening the zip file (without downloading or navigating anywhere else) |
There is Playwright's CLI command show-trace, does it serve your needs?
|
hi, in Node, if we set reporter=html, the test results are outputed into a zip that is accessed as an html file. this makes it very easy to send the results to people who do not have playwright installed (they can just open the html file, and see all test results and traces, without needing https://trace.playwright.dev/ to view the trace, and without installing playwright locally). This functionality exists in node, but not in python :( |
@arieluchka-bse I agree such case is useful. |
Trace view in Cucumber HTML report is released in Playwright-bdd v7.5.0. |
Hi @vitalets, the html report looks great.
One thing I wanted to ask if you can make it possible the traces of a failed test to be opened directly within the browser with a click. Currently I need to download the trace file and open it with command 'npx playwright show-trace ....'.
Within TeamCity when I am using the playwright html report I also have the option to just click it and it will open in a frame, so no need to download it.
this is sample from the html how it is opened in TeamCity iframe
Maybe passing the URL of the traces could help
Originally posted by @NikkTod in #9 (comment)
The text was updated successfully, but these errors were encountered: