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

E2E tests fix in GB build #95282

Merged
merged 5 commits into from
Oct 10, 2024
Merged

E2E tests fix in GB build #95282

merged 5 commits into from
Oct 10, 2024

Conversation

Imran92
Copy link
Contributor

@Imran92 Imran92 commented Oct 10, 2024

Related to fixing e2e tests on Gutenberg build https://teamcity.a8c.com/viewLog.html?buildId=13488805

Proposed Changes

  • Gutenberg has a set of social icon blocks which often have the same name as the Embed blocks. So some E2E tests insert the social icon block instead which fails the rest of the test.

"YouTube Embed" block had a fallback named "YouTube", we've removed that to prevent the E2E from selecting the YouTube icon because of that.

Instagram's embed block name should be changed to "Instagram Embed" from "Instagram". As both of these blocks have the same name, I've made the test search in the inserter first using "Instagram embed" so that only the Embedding block remains. And then went with the inserting process.

The actual solution for this Instagram block would be to change the block's name in Gutenberg. So the current fix is a temporary one to enable a faster release. I'll create a PR on GB changing the name of the block later. Then we can remove this workaround.

Screenshot 2024-10-10 at 7 38 53 PM

Why are these changes being made?

  • To fix tests.

Testing Instructions

  • Gutenberg E2E tests should pass.

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-aUh-p2)?

@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.

@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 Oct 10, 2024
@Imran92 Imran92 self-assigned this Oct 10, 2024
@Imran92 Imran92 changed the title Draft: E2E tests fix attempt E2E tests fix attempt Oct 10, 2024
@Imran92 Imran92 requested a review from a team October 10, 2024 15:22
@Imran92 Imran92 changed the title E2E tests fix attempt E2E tests fix in GB build Oct 10, 2024
@Imran92 Imran92 marked this pull request as ready for review October 10, 2024 15:23
Copy link
Contributor

@rafaelgallani rafaelgallani left a comment

Choose a reason for hiding this comment

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

As a temporary fix, these changes look good to me.
However, some tests still fail in nightly + atomic + mobile builds.
This is what I get:

image

@@ -68,7 +68,10 @@ export function createBlockTests( specName: string, blockFlows: BlockFlow[] ): v
const blockHandle = await editorPage.addBlockFromSidebar(
blockFlow.blockSidebarName,
blockFlow.blockEditorSelector,
{ noSearch: true, blockFallBackName: blockFlow.blockTestFallBackName }
{
noSearch: blockFlow.noSearch === false ? false : true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicky - this works well enough, but I would use null coalescing here:

Suggested change
noSearch: blockFlow.noSearch === false ? false : true,
noSearch: blockFlow.noSearch ?? true,

Then, if there's any non-nullish value in noSearch (anything other than null or undefined), it'd be used. Otherwise, it'd default to true. But that's just a preference - explicitly checking for false also works.

Copy link
Contributor

@rafaelgallani rafaelgallani left a comment

Choose a reason for hiding this comment

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

LGTM, the latest commit (c03aa49) fixed the tests.
I can confirm both specs/blocks/blocks__core.ts and specs/blocks/blocks__core-jetpack-extended.ts tests are passing for:

  • Simple
  • Simple + Edge
  • Atomic
  • Atomic + Edge
  • Atomic + Nightly

@Imran92 Imran92 merged commit 22a9430 into trunk Oct 10, 2024
10 checks passed
@Imran92 Imran92 deleted the fix/e2e-test-for-some-blocks branch October 10, 2024 16:54
@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 Oct 10, 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.

3 participants