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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support artifact collection with multiple contexts #216

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

mxschmitt
Copy link
Member

@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
pytest_playwright/pytest_playwright.py Outdated Show resolved Hide resolved
os.makedirs(os.path.dirname(trace_path), exist_ok=True)
shutil.move(trace, trace_path)
else:
os.remove(trace)
Copy link

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
Member Author

Choose a reason for hiding this comment

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

Addressed.

pytest_playwright/pytest_playwright.py Show resolved Hide resolved
@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
14 of 17 checks passed
@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