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 an end-to-end (E2E) test to ensure the Focal Point Picker in the Cover block works correctly.
Why?
We've encountered regressions in the past related to the Cover block's Focal Point Picker (e.g., #28487). Currently, there is no E2E test coverage for this feature, so adding a test will help prevent future regressions.
How?
Inserts a Cover block in the editor.
Uploads an image to the Cover block.
Uses the Focal Point Picker to set specific values for the left and top focal points.
Verifies that the values are correctly applied and constrained within the valid range.
Testing Instructions
Run the test using the following command:
npm run test:e2e /Users/im3dabasia/Desktop/gutenberg/test/e2e/specs/editor/blocks/cover.spec.js
To run only this test, temporarily modify the test to use .only() like this:
test.only( 'can use focal point picker...', async () => { ... } );
For debugging, change headless to false in the playwright.config.js file to view the UI while the test runs.
Screencast
Screen.Recording.2025-02-06.at.5.08.46.PM.mov
Screenshot of the test cases for the Cover block. Observe the 8th test case, which has been added in this PR.
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.
Mamaduka
added
[Type] Automated Testing
Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
[Block] Cover
Affects the Cover Block - used to display content laid over a background image
labels
Feb 9, 2025
* feat: Add e2e test for focal point picker in cover block
* fix: Use existing editor API to select blocks
* fix: Refactored to use Accessible selectors while selecting focalPointInputs
* feat: Expect cover block to have updated focalPoint attributes
* feat: Expect the visual DOM to have the CSS applied because of updates in focals
* feat: Update the focal inputs to have different values for top and left
* feat: Add toMatchObject for the check for attributes in core/cover
* feat: Update frontend expect to have 30% in left object-position
Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ockham <bernhard-reiter@git.wordpress.org>
[Block] CoverAffects the Cover Block - used to display content laid over a background image[Type] Automated TestingTesting infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
3 participants
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.
What?
Closes: #29002
This PR adds an end-to-end (E2E) test to ensure the Focal Point Picker in the Cover block works correctly.
Why?
We've encountered regressions in the past related to the Cover block's Focal Point Picker (e.g., #28487). Currently, there is no E2E test coverage for this feature, so adding a test will help prevent future regressions.
How?
Testing Instructions
Run the test using the following command:
To run only this test, temporarily modify the test to use
.only()
like this:For debugging, change headless to false in the playwright.config.js file to view the UI while the test runs.
Screencast
Screen.Recording.2025-02-06.at.5.08.46.PM.mov
Screenshot of the test cases for the Cover block. Observe the 8th test case, which has been added in this PR.