-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add additional e2e debugging option #21845
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
Conversation
|
I'm about to merge #21653
I think that it largely overlaps with unit tests so maybe we just move the existing section to the shared |
df156ed to
7afaadc
Compare
|
@gziolo I like the idea! I figured the docs should also include some info about node options so I added that section and put it under there instead. Do you think that makes sense as a place to put it? The |
Awesome, super helpful 🤩 Should it be moved before the list of scripts maybe or is it too advanced use case?
Now we have two advanced sections, but only the second is linked. So maybe we consolidate it as one? I plan to test it tomorrow and land |
As a reader of the documentation I'm probably more likely to be looking for which scripts are available rather than seeing how to pass Node.js options to a script, so it makes sense to not put too much before the "available scripts" section.
Now that you mention it, the word 'advanced' is probably a little overused in this document. Debugging unit tests shouldn't be considered "advanced"—it should be a technique that everyone feels comfortable using. I think "Passing Node.js options" may be a little more clear. All the other options aside from
❤️ |
|
I like all the revisions applied since I last viewed 💯 |
| * `npm run test-e2e -- --puppeteer-interactive` - runs all e2e tests interactively. | ||
| * `npm run test-e2e FILE_NAME -- --puppeteer-interactive ` - runs one test file interactively. | ||
| * `npm run test-e2e:watch -- --puppeteer-interactive` - runs all tests interactively and watch for changes. | ||
| * `npm run test-e2e:debug` - runs all tests interactively and enables [debugging tests](#debugging-e2e-tests). |
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.
great idea to cross-link here 👍
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.
It works like a charm. I love it. This is how it looks in action. Well, I need to convert screen recording into GIF ...
Update: it looks like GIF is too big so I used Twitter:
https://video.twimg.com/ext_tw_video/1254999864280264704/pu/pl/aULuGCn7NkSB654x.m3u8
Description
Getting node debugging working for e2e tests in #21631 was a bit more involved than just add the
--inspect-brkflag towp-scripts --inspect-brk test-e2e, so I'm moving the additional code and documentation changes to a new pull request.PUPPETEER_DEVTOOLSenvironment (defaultfalse) to enable the devtools launch option.--puppeteer-devtoolsoption totest-e2eto automatically open the devtools.test-e2e:debugnpm script with--inspect-brk(from wp-scripts test-unit-js node debugging #21631) and--puppeteer-devtools.How has this been tested?
test-e2e:debugwith breakpoints set in:testcontext (adddebugger;within atest)evaluatecontext (addawait page.evaluate( () => { debugger; } );within atest)windowcontext (adddebugger;within any front-end code that would be run)Types of changes
New feature
Checklist: