Post Visibility e2e test: Improve XPath selector to avoid reliance on DOM structure #38717
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 futurecc @ciampo
Types of changes
enhancement
Checklist:
*.native.js
files for terms that need renaming or removal).