feat: --debug=cli exposes external playwright-cli session#39113
feat: --debug=cli exposes external playwright-cli session#39113dgozman wants to merge 3 commits intomicrosoft:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b4867eb to
60ac35d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
60ac35d to
c6de7ed
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
c6de7ed to
41b324c
Compare
Test results for "MCP"13 fatal errors, not part of any test Merge workflow run. |
Test results for "tests 1"10 failed 2 flaky38513 passed, 843 skipped Merge workflow run. |
|
|
||
| const sessionConfigFile = this._sessionFile('.session'); | ||
| this.config.version = this._clientInfo.version; | ||
| this.config.timestamp = Date.now(); |
| } | ||
|
|
||
| export async function handleOnTestFunctionEnd(testInfo: TestInfo, context: playwright.BrowserContext) { | ||
| const sessionConfig = sessionConfigFromArgs(createClientInfo(), createGuid().slice(0, 8), { _: [] }); |
There was a problem hiding this comment.
I'd prefer the session name to be readable, not a GUID. maybe the test title?
|
|
||
| To debug a failing test, run it with Playwright as usual, but append `--debug=cli` option. This command will pause the test at the point of failure, and print the "socket path" and instructions. | ||
|
|
||
| IMPORTANT: run the command in the background and check the output until instructions are available. |
There was a problem hiding this comment.
speculative: let's mention a pattern it can wait for, i imagine that some harnesses can wait for the stdout to match a regex like "Listening on".
| IMPORTANT: run the command in the background and check the output until instructions are available. | |
| IMPORTANT: run the command in the background and check the output until instructions are available, it'll print `Debugging Instructions` |
| Keep the test running in the background while you explore and look for a fix. After fixing the test, stop the background test run. | ||
|
|
||
| Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code. | ||
| This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated. |
There was a problem hiding this comment.
Should we mention that sometimes, the test is right and there's an app bug?
No description provided.