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

Fix flaky test of data-wp-on-window directive #58642

Merged
merged 3 commits into from Feb 3, 2024

Conversation

luisherranz
Copy link
Member

What?

Another attempt to fix #58398.

Why?

It keeps failing sometimes.

How?

I added this line to expect that the event listener is attached, but didn't use expect to make sure Playwright waits until this happens. Instead, I used waitForSelector:

// Make sure the event listener is attached.
await page.waitForSelector('[data-testid="isEventAttached"]:has-text("yes")');

I also removed the other test because it was unnecessary. The longer test was covering the same again.

@luisherranz luisherranz added [Type] Bug An existing feature does not function as intended [Packages] Interactivity /packages/interactivity labels Feb 3, 2024
@luisherranz luisherranz self-assigned this Feb 3, 2024
@luisherranz luisherranz enabled auto-merge (squash) February 3, 2024 08:34
Copy link

github-actions bot commented Feb 3, 2024

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.

Core SVN

If you're a Core Committer, use this list when committing to wordpress-develop in SVN:

Props: luisherranz, mamaduka.

GitHub Merge commits

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: luisherranz <luisherranz@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@luisherranz luisherranz merged commit f38eb42 into trunk Feb 3, 2024
56 checks passed
@luisherranz luisherranz deleted the fix/flaky-test-on-window-directive branch February 3, 2024 20:12
@github-actions github-actions bot added this to the Gutenberg 17.7 milestone Feb 3, 2024
@MaggieCabrera MaggieCabrera added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Feb 9, 2024
Copy link

github-actions bot commented Feb 9, 2024

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: [Type] Bug, [Type] Automated Testing, [Packages] Interactivity.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Packages] Interactivity /packages/interactivity [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flaky Test] callbacks should run whenever the specified event is dispatched
3 participants