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

Flaky E2E: avoid using the sidebar to insert Paragraph and Image blocks in certain specs. #73561

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

worldomonation
Copy link
Contributor

@worldomonation worldomonation commented Feb 20, 2023

Related to #72298

Proposed Changes

This PR works around the pre-existing but exacerbated with Gutenberg 15.1.x issue of slow loading times for page templates, when the block inserter sidebar search is used.

For a demonstration of the issue, please see WordPress/gutenberg#48085.

Key changes:

  • add an optional param noSearch in order to not use the sidebar search to filter out blocks. This is to work around the slow loading of blocks and patterns caused by Gutenberg 15.1.x.
  • update insertion of ParagraphBlock to bypass the search.

Testing Instructions

Ensure the following build configurations are passing reliably. Trigger multiple times as required:

  • Gutenberg E2E (desktop)
  • Gutenberg E2E (mobile)
  • Calypso E2E (desktop)
  • Calypso E2E (mobile)

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

- add an optional param `noSearch` in order to not use the sidebar search to filter out blocks. This is to work around the slow loading of blocks and patterns caused by Gutenberg 15.1.x.

test/e2e/specs/editor/editor__post-advanced-flow.ts
- update insertion of ParagraphBlock to bypass the search.
@github-actions
Copy link

github-actions bot commented Feb 20, 2023

@worldomonation worldomonation marked this pull request as ready for review February 20, 2023 23:38
@worldomonation worldomonation requested a review from a team as a code owner February 20, 2023 23:38
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 20, 2023
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@@ -58,7 +58,8 @@ describe( DataHelper.createSuiteTitle( `Editor: Advanced Post Flow` ), function
it( 'Enter post content', async function () {
const blockHandle = await editorPage.addBlockFromSidebar(
ParagraphBlock.blockName,
ParagraphBlock.blockEditorSelector
ParagraphBlock.blockEditorSelector,
{ noSearch: true }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Paragraph block is only directly inserted with the Editor: Post Advanced Flow spec. Since searching for "Paragraph" returns slow loading patterns, the noSearch optional param is used to specify that Playwright is to select directly from the block listing that is shown when opening the sidebar.

Copy link
Contributor

@karenroldan karenroldan left a comment

Choose a reason for hiding this comment

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

Thanks for this solution, Edwin! It was much simpler than I thought when I stumbled on this issue.

thought (non-blocking): I see the same issue when running blocks__media.ts where it also searches for the "Image" block and the return was really slow. The test even focused and hovered on the "Instagram" block instead.

What are your thoughts on implementing the noSearch: true for the Image block in blocks__media.ts or we resort to selecting directly from the block listing?

@worldomonation
Copy link
Contributor Author

thought (non-blocking): I see the same issue when running blocks__media.ts where it also searches for the "Image" block and the return was really slow. The test even focused and hovered on the "Instagram" block instead.

What are your thoughts on implementing the noSearch: true for the Image block in blocks__media.ts or we resort to selecting directly from the block listing?

Let's do that - we can retain coverage for "searching for a block to insert" elsewhere using blocks that do not "stress" the editor as much.

I'll push changes for blocks__media and merge the changes. Thank you!

- set the `noSearch` parameter to true.
@worldomonation worldomonation changed the title Flaky E2E: avoid using the sidebar to insert Paragraph blocks. Flaky E2E: avoid using the sidebar to insert Paragraph and Image blocks in certain specs. Feb 21, 2023
@worldomonation worldomonation merged commit 9498677 into trunk Feb 21, 2023
@worldomonation worldomonation deleted the fix/e2e-enter-post-content branch February 21, 2023 18:50
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants