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

Fixes e2e test failures via console log exception to handle temp wpnonce error #19532

Merged
merged 2 commits into from
Jan 10, 2020

Conversation

getdave
Copy link
Contributor

@getdave getdave commented Jan 9, 2020

[DOM] Found 2 elements with non-unique id #_wpnonce: (More info: https://goo.gl/9p2vKq)

This error was getting logged to console when running e2e tests locally and causing my tests to fail. It’s a known issue with WordPress:
https://core.trac.wordpress.org/ticket/23165.

This commit adds a new condition to console log exception handling in e2e tests to ensure console logs containing this message are ignored and do not trigger test failures.

See also https://wordpress.slack.com/archives/C02QB2JS7/p1578578973183100 (requires registration)

Originally committed here.

How has this been tested?

Difficult to test but requires running the e2e tests.

Best way is to check out this branch and run the e2e tests. You will see that the e2e tests pass when code from this PR is added and they fail when it is removed.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

>  [DOM] Found 2 elements with non-unique id #_wpnonce: (More info: https://goo.gl/9p2vKq)

This error was getting logged to console when running e2e tests locally and causing my tests to fail. It’s a known issue with WordPress:
https://core.trac.wordpress.org/ticket/23165.

This commit adds a new condition to console log exception handling to ensure console logs containing this message are ignored and do not trigger test failures.

See also https://wordpress.slack.com/archives/C02QB2JS7/p1578578973183100
@getdave getdave added [Type] Bug An existing feature does not function as intended [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked. [Package] E2E Tests /packages/e2e-tests labels Jan 9, 2020
@getdave getdave requested a review from aduth January 9, 2020 14:56
@getdave getdave self-assigned this Jan 9, 2020
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Based on our conversation in Slack (linked in the original comment), I'm fine with this as a short-term solution until the issue can be resolved in core.

packages/e2e-tests/config/setup-test-framework.js Outdated Show resolved Hide resolved
@getdave getdave requested a review from aduth January 10, 2020 14:12
@getdave getdave merged commit 256f67c into master Jan 10, 2020
@getdave getdave deleted the fix/wpnonce-error-e2e-test-local-failures branch January 10, 2020 14:38
@ellatrix ellatrix added this to the Gutenberg 7.3 milestone Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Tests /packages/e2e-tests [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Bug An existing feature does not function as intended [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants