Skip to content

Conversation

@Sidsector9
Copy link
Contributor

@Sidsector9 Sidsector9 commented Feb 1, 2024

Description of the Change

This PR:

  • fixes the insertBlock, createPost and openDocumentSettingSidebars commands.
  • updates NPM dependencies.
  • Renames check-block-pattern-exists.test.js to z.check-block-pattern-exists.test.js as the order of this test affects the outcome of other tests. (I couldn't figure out the reason yet.)

How to test the Change

Confirm in the E2E log if this command passes in the 3 WP versions.

Changelog Entry

Fixed - Failing insertBlock command

Credits

Props @Sidsector9

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@Sidsector9 Sidsector9 requested a review from a team as a code owner February 1, 2024 15:34
@Sidsector9 Sidsector9 requested review from peterwilsoncc and removed request for a team February 1, 2024 15:34
@jeffpaul jeffpaul added this to the 0.3.0 milestone Feb 1, 2024
@Sidsector9 Sidsector9 changed the title fix insertBlock command to work from WP 5.7 to 6.4 fix commands to work from WP 5.7 to 6.4 Feb 4, 2024
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

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

@Sidsector9 Tests are passing on the GH action and PR LGTM. just added one minor comment to discuss. once it is concluded we are good to merge this.

Thanks for fixing this.

Co-authored-by: Dharmesh Patel <[email protected]>
@jeffpaul jeffpaul linked an issue Feb 12, 2024 that may be closed by this pull request
1 task
@jeffpaul
Copy link
Member

@Sidsector9 @iamdharmesh is the WP latest failure a concern here or good to merge this in?

@Sidsector9 Sidsector9 requested a review from jeffpaul as a code owner February 13, 2024 02:11
@peterwilsoncc
Copy link
Contributor

The WP Latest test failures are intermittent both locally and in the GH Actions. Running in the browser I am seeing some issues with the rendering of the editors iframe but I am unsure if that is happening in the GH actions too.

In the most recent push, the first run fails with Create Post > Should be able to create Page

In the second run both Create Post > Should be able to create Page and Create Post > Should be able to create Draft Page fail.

Similar happening elsewhere.

@darylldoyle
Copy link
Contributor

@peterwilsoncc I've taken a look at this and whilst I can't replicate the error locally, I do see the following in the artifacts from the latest GH Actions failure:

Command checkPostExists -- Post 9d0f6af9 should exist -- before all hook (failed)

This seems to me that something is causing the editor to fall over. Is there anyway to get more information about general JS errors rather than Cypress specific errors? That will likely give us more insight into what's going on under the hood.

@peterwilsoncc
Copy link
Contributor

I've been able to reproduce locally using the electron browser rather than Chrome but not seeing any hints in the console when running cypress open.

@darylldoyle
Copy link
Contributor

Thanks @peterwilsoncc! Running in Electron I was able to reproduce that error. If I enable SCRIPT_DEBUG, I can see the following error.

image

This error points at this line:

https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/image/use-client-width.js#L20

Interestingly, if you log out ref.current.ownerDocument, the defaultView property is null:

Screenshot 2024-02-15 at 14 31 23

Yet if you log out the extracted defaultView const, you get this:

image

but notice how removeEventListener() isn't a function defined on that object 🤔

I'm assuming this is a bug in Electron browser windows, but I'm not sure where that leaves us or this test.

@peterwilsoncc
Copy link
Contributor

@darylldoyle Thank you! That's a great help.

In 9fffc47 I've switched the GitHub actions to use Chrome and will run the test suite a few times to see if it ends up less flaky.

It's probably a good thing to do as it better represents what the end user is running and that's the purpose of the test suite.

peterwilsoncc
peterwilsoncc previously approved these changes Feb 16, 2024
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

I think this is good to go now the flakey tests have been resolved by using chrome on GitHub.

It could probably do with another approval as I've pushed a few changes:

  • updated winamp plugin
  • modified plugin test to allow for versions of WP unsupported by the plugin

@Sidsector9
Copy link
Contributor Author

Sidsector9 commented Feb 16, 2024

cc: @iamdharmesh we've switched back to Chrome 😄

@jeffpaul jeffpaul removed their request for review April 4, 2024 16:30
@Sidsector9 Sidsector9 merged commit 57d84c6 into develop Apr 5, 2024
@Sidsector9 Sidsector9 deleted the fix/insert-block branch April 5, 2024 11:59
github-actions bot pushed a commit that referenced this pull request Apr 5, 2024
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.

WP 6.5 breaks openDocumentSettingsSidebar command

5 participants