Playwright - add java sources to a captured Playwright trace - #1450
Open
antonfilichkin wants to merge 1 commit into
Open
antonfilichkin wants to merge 1 commit into
antonfilichkin wants to merge 1 commit into
Conversation
…spectJ frames from trace stacks Playwright's Tracing.StartOptions#setSources embeds a stack per action, but frame 0 is always synthetic AspectJ-weaving glue inserted by AllurePlaywrightAspect, not the real caller - making Trace Viewer's Source tab useless without this. - Add allure.playwright.trace.sources (default false) to opt into embedding sources in the trace. - Add TraceStackSourceTrimmer, which rewrites the trace.stacks entry in place: it resolves the first file-backed frame in each stack, falling back to stripping the leading run of recognizable AspectJ/Playwright weaving frames when no frame resolves. Fails open on any error, leaving the trace attached unchanged. - Declare the module's new compile-time-only dependency on Gson in module-info.java.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Allows attaching java sources to Playwright traces.
Allure only configures Playwright traces to include screenshots and snapshots via
Playwright allows including java sources by setting PLAYWRIGHT_JAVA_SRC and configuring tracing via
The problem:
.zipbinaryThe idea is to add configurable option to allow Allure rewrite sources and remove it's own synthetic frames
Implementation idea:
allure.playwright.trace.sources(default false) to opt into embedding sources in the trace.TraceStackSourceTrimmer, which rewrites thetrace.stacksentry in place: it resolves the first file-backed frame in each stack, falling back to stripping the leading run of recognizable AspectJ/Playwright weaving frames when no frame resolves. Fails open on any error, leaving the trace attached unchanged. With some short-circuits to disable zip/json processing - I.e. binary blobs, sources path not set.Trace examples (both with sources)

npx playwright show-trace trace-after.ziptrace-before.zip
trace-after.zip
Checklist