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

Update our blocks apiVersion from 2 to 3 #4029

Merged
merged 11 commits into from
Dec 5, 2024
Merged

Conversation

dkotter
Copy link
Contributor

@dkotter dkotter commented Dec 5, 2024

Description of the Change

This is a follow on from the work started in #3863. We update the apiVersion in all of our blocks from 2 to 3, to allow the iframed editor to work correctly.

This change causes some of our E2E tests to start failing, as we now need to interact with the block editor in an iframe state, something Cypress has issues with without changes. The following changes have been made:

  1. Introduce a new getBlockEditor command that will return the block editor iframe
  2. Anywhere we need to interact with the editor, use that new command
  3. Introduce a new getIframe function that the getBlockEditor command uses to properly get the block editor iframe
  4. Introduce a new closeBlockInserter command to close the block inserter. In running tests locally, was seeing some issues where after adding a block, if the block inserter wasn't closed, Cypress was complaining about elements not being ready to interact with
  5. Set chromeWebSecurity in our Cypress config to false to allow Cypress to properly interact with iframes
  6. Add some wait commands to ensure things save properly. Not sure if that will be needed in our pipelines but running tests locally, sometimes things fire too quickly and changes we're making end up not getting saved (and causes tests to fail)

Closes #3853

How to test the Change

Main thing to test here is that all blocks still work as expected.

Also ensure all E2E tests pass.

Changelog Entry

Changed - Update all of our blocks apiVersion from 2 to 3, to indicate support for working in an iframed editor
Developer - Update E2E tests to work properly with the iframed block editor

Credits

Props @dkotter, @JakePT

Checklist:

@dkotter dkotter self-assigned this Dec 5, 2024
@dkotter dkotter added this to the 5.1.4 milestone Dec 5, 2024
@dkotter dkotter changed the title WIP: Update our blocks apiVersion from 2 to 3 Update our blocks apiVersion from 2 to 3 Dec 5, 2024
@dkotter dkotter marked this pull request as ready for review December 5, 2024 19:20
@dkotter dkotter requested a review from felipeelia December 5, 2024 19:21
@dkotter
Copy link
Contributor Author

dkotter commented Dec 5, 2024

@fabiankaegy @felipeelia I've updated all of the custom blocks from apiVersion 2 to 3 and also have updated E2E tests to work with the iframed editor. All tests are passing though note I didn't do much in the way of formal QA on the blocks so probably worth some manual testing here to ensure those all still work as expected

@felipeelia
Copy link
Member

Thank you VERY much @dkotter. I'm merging this one now, as a new EP release is coming in the next few days and blocks will be thoroughly QA'd during that.

@felipeelia felipeelia merged commit 8ba3d18 into develop Dec 5, 2024
22 checks passed
@felipeelia felipeelia deleted the feature/3853-v2 branch December 5, 2024 19:28
@fabiankaegy
Copy link
Member

🥳 Thanks so much for pushing this forward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adopt Block API version 3
3 participants