You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR adds e2e tests to ensure that the "Randomize order" setting of the Gallery block works correctly.
Why?
As commented here, we need to use a regular expression to randomize the images inside the Gallery block.
As a result, if the HTML output by the Image block changes in the future, it may no longer match this regular expression, and randomization may no longer work.
How?
Test that the randomization works in both scenarios, with and without the lightbox effect on the image. These E2E tests inject sequential numbers into the alt text and verify that they do NOT match between the editor and the front-end. It is highly unlikely that the order of the Alt text will ever change on the front end, so these tests will never fail.
Testing Instructions
Run npm run test:e2e test/e2e/specs/editor/blocks/gallery.spec.js
You can also make the tests fail intentionally to better understand what it's trying to do:
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
Flaky tests detected in a13bece.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
* Gallery Block: Add E2E test for image randomization
* Use actually uploaded media
* Update test title
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
* Gallery Block: Add E2E test for image randomization
* Use actually uploaded media
* Update test title
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
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.
Closes #71432
What?
This PR adds e2e tests to ensure that the "Randomize order" setting of the Gallery block works correctly.
Why?
As commented here, we need to use a regular expression to randomize the images inside the Gallery block.
As a result, if the HTML output by the Image block changes in the future, it may no longer match this regular expression, and randomization may no longer work.
How?
Test that the randomization works in both scenarios, with and without the lightbox effect on the image. These E2E tests inject sequential numbers into the alt text and verify that they do NOT match between the editor and the front-end. It is highly unlikely that the order of the Alt text will ever change on the front end, so these tests will never fail.
Testing Instructions
Run
npm run test:e2e test/e2e/specs/editor/blocks/gallery.spec.js
You can also make the tests fail intentionally to better understand what it's trying to do: