Skip to content

feat: support artifact collection with multiple contexts#216

Merged
mxschmitt merged 3 commits intomainfrom
support-multiple-contexts
Apr 16, 2024
Merged

feat: support artifact collection with multiple contexts#216
mxschmitt merged 3 commits intomainfrom
support-multiple-contexts

Conversation

@mxschmitt
Copy link
Copy Markdown
Contributor

@mxschmitt mxschmitt commented Apr 12, 2024

Before this patch manually created contexts were not taken into consideration for tracing, video, and screenshot generation. After this patch tracing and video is fully supported. Screenshots get only taken for pages which are still open, this was already the case before.

The signature of new_context needs to be manually getting mirrored, I found no way of doing this like we can in e.g. TypeScript.

Unrelated: Supporting retries might be something we can support in the future, but this is not in scope of this PR.

Fixes #209
Fixes #111
Fixes #99

@mxschmitt mxschmitt force-pushed the support-multiple-contexts branch 2 times, most recently from 3c5772a to caf2c38 Compare April 12, 2024 22:03
@mxschmitt mxschmitt changed the title Support multiple contexts feat: Support artifact collection with multiple contexts Apr 12, 2024
@mxschmitt mxschmitt changed the title feat: Support artifact collection with multiple contexts feat: support artifact collection with multiple contexts Apr 12, 2024
@mxschmitt mxschmitt force-pushed the support-multiple-contexts branch from 8905f0a to c0db2a6 Compare April 15, 2024 20:15
@mxschmitt mxschmitt marked this pull request as ready for review April 15, 2024 20:15
Comment thread pytest_playwright/pytest_playwright.py Outdated
Comment thread pytest_playwright/pytest_playwright.py Outdated
os.makedirs(os.path.dirname(trace_path), exist_ok=True)
shutil.move(trace, trace_path)
else:
os.remove(trace)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also remove when !failed and self._tracing_option == "retain-on-failure"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

Comment thread pytest_playwright/pytest_playwright.py
@mxschmitt mxschmitt force-pushed the support-multiple-contexts branch from a780f91 to 9e81611 Compare April 16, 2024 19:47
@mxschmitt mxschmitt merged commit 2d5a080 into main Apr 16, 2024
@mxschmitt mxschmitt deleted the support-multiple-contexts branch April 16, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants