-
Notifications
You must be signed in to change notification settings - Fork 69
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
docs: add guide about debugging Playwright Python #5
Conversation
cf0723c
to
87cdda6
Compare
I'm not a huge fan of taking a screenshot on failure. We should instead do the video and dom snapshots. Would not want screenshot on failure to be adopted - would make the right solution harder to discover. |
87cdda6
to
0957255
Compare
0957255
to
66d3323
Compare
Pull Request Test Coverage Report for Build 202919278Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
README.md
Outdated
@@ -115,6 +115,26 @@ def test_visit_admin_dashboard(page: Page): | |||
# ... | |||
``` | |||
|
|||
## Debugging | |||
|
|||
To pause the Pytest test execution and interact with the browser via the developer tools or call Playwright interactively, you can use the `breakpoint()` statement in your code to get a [pdb](https://docs.python.org/3/library/pdb.html) inline REPL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth noting that should be started as headful.
Currently its hard to debug Playwright Pytest tests on bots when they are failing until screencast is not ready. Many users in the Jest world use such a feature for debugging the tests or getting insights why something is not working when they are failing on the bots.
This implementation is opt-in and will create a screenshot when a test is failing, in the future we can add a screencast recording for each test in the folder too.
Blocked by upstream: microsoft/playwright-python#166
I think we could also add a
--breakpoint-on-error
flag e.g. which will start a REPL once a test is failing. Also opt-in. Then the user can interact with the browser via the headful instance or via the REPL.