-
Notifications
You must be signed in to change notification settings - Fork 309
Refactor bootstrap.js for E2E #10860
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
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.
Thanks @ankitrox, this is looking good - it just needs a number of inline comments to be restored or fixed. Please see my comments on the PR for details.
tests/e2e/config/bootstrap.js
Outdated
// Before every test suite run, delete all content created by the test. This ensures | ||
// other posts/comments/etc. aren't dirtying tests and tests don't depend on | ||
// each other's side-effects. | ||
// Before every test suite run, delete all content created by the test. |
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.
Please restore the full comment here.
tests/e2e/config/bootstrap.js
Outdated
@@ -364,25 +382,21 @@ async function observeRestResponse( res ) { | |||
if ( res.url().match( 'wp-json' ) ) { | |||
const data = [ res.status(), res.request().method(), res.url() ]; | |||
|
|||
// The response may fail to resolve if the test ends before it completes. |
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.
Please restore this comment.
tests/e2e/config/bootstrap.js
Outdated
// At this point, any unexpected message will result in a test failure. | ||
|
||
// Check if it's raised by the AMP plugin. | ||
// Check if it's raised by the AMP plugin |
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.
Please restore the removed/modified comment here.
tests/e2e/config/bootstrap.js
Outdated
// removed once the associated ticket has been closed. | ||
// | ||
// See: https://core.trac.wordpress.org/ticket/47183 | ||
// Check if the message should be ignored |
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.
This comment should end in a full stop:
// Check if the message should be ignored | |
// Check if the message should be ignored. |
tests/e2e/config/bootstrap.js
Outdated
* Array of console messages to ignore. | ||
*/ | ||
const IGNORE_CONSOLE_MESSAGES = [ | ||
// An exception is made for _blanket_ deprecation warnings |
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.
Please restore the full comment for this check, as illustrated below.
There are other checks which have also had their comments truncated or modified as part of this refactor. Please review all of the checks, and restore their full comments.
// An exception is made for _blanket_ deprecation warnings | |
// An exception is made for _blanket_ deprecation warnings: Those | |
// which log regardless of whether a deprecated feature is in use. |
Thank you @techanvil for looking into the code review. I have addressed the comments regarding comments restoration and also restored at some other places where those were missing. Assigning this to you to review the changes. Thanks again! |
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.
LGTM, nice one @ankitrox!
Summary
Addresses issue:
tests/e2e/config/bootstrap.js
#10369Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist