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

Post Visibility e2e test: Improve XPath selector to avoid reliance on DOM structure #38717

Merged

Conversation

chad1008
Copy link
Contributor

Description

As discussed in #37491 (comment), this PR modifies the XPath selector targeting a future date for the post's publication when running post visibility e2e tests. The new XPath makes the test more resilient by avoiding reliance on DOM structure which could change in the future.

Testing Instructions

From your local Gutenberg directory, run
npx wp-scripts test-e2e --config packages/e2e-tests/jest.config.js packages/e2e-tests/specs/editor/various/post-visibility.test.js. All tests should pass, specifically final test related to changing post visibility when the publication date is in the future

cc @ciampo

Types of changes

enhancement

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • 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 (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@ciampo ciampo self-requested a review February 11, 2022 10:22
@ciampo ciampo added the [Package] Components /packages/components label Feb 11, 2022
@ciampo ciampo added [Package] E2E Tests /packages/e2e-tests [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. and removed [Package] Components /packages/components labels Feb 11, 2022
@chad1008 chad1008 force-pushed the fix/improve-post-visibility-test-xpath branch from 70b86d2 to d23ed26 Compare February 21, 2022 21:07
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

This PR may need a rebase to get rid of the failing e2e test

@chad1008 chad1008 force-pushed the fix/improve-post-visibility-test-xpath branch from d23ed26 to a96b2af Compare February 22, 2022 10:57
@chad1008
Copy link
Contributor Author

rebased and passing! ✅

@ciampo
Copy link
Contributor

ciampo commented Feb 22, 2022

The CI failure (the Gradle cache can't be restored when running React Native E2E tests) doesn't seem related to the changes in this PR, I'm going to merge

@ciampo ciampo merged commit cca9e4f into WordPress:trunk Feb 22, 2022
@github-actions github-actions bot added this to the Gutenberg 12.7 milestone Feb 22, 2022
@chad1008 chad1008 deleted the fix/improve-post-visibility-test-xpath branch February 22, 2022 13:48
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants