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 in rich text. #22202

Merged
merged 1 commit into from
May 8, 2020
Merged

Fix flaky test in rich text. #22202

merged 1 commit into from
May 8, 2020

Conversation

sainthkh
Copy link
Contributor

@sainthkh sainthkh commented May 8, 2020

Description

It seems that there's a racing condition between:

  • loading a new rich text editor.
  • pressing ctrl + b

I've resolved this by waiting for loading a new rich text editor.

How has this been tested?

Manually running it.

Screenshots

N/A

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • [N/A] My code follows the accessibility standards.
  • [N/A] My code has proper inline documentation.
  • [N/A] I've included developer documentation if appropriate.
  • [N/A] I've updated all React Native files affected by any refactorings/renamings in this PR.

@gziolo gziolo added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Package] E2E Tests /packages/e2e-tests labels May 8, 2020
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

It looks like an improvement 👍

@gziolo gziolo merged commit c9ce32f into WordPress:master May 8, 2020
@github-actions github-actions bot added this to the Gutenberg 8.1 milestone May 8, 2020
@aduth
Copy link
Member

aduth commented May 8, 2020

While this can work, and waitForSelector is often an inevitable choice, I think it's worth noting that waitForSelector could actually imply the user has to physically sit and wait before they can proceed. And at least in these sorts of text-writing workflows, we shouldn't ever expect a user to have to wait between pressing Enter to create a new paragraph, then proceeding to type in that paragraph.

@aduth
Copy link
Member

aduth commented May 8, 2020

Also, heads-up that if you want, as a Member, you should be able to create branches directly from the Gutenberg source repository, rather than working from your fork.

@aduth
Copy link
Member

aduth commented May 8, 2020

@sainthkh
Copy link
Contributor Author

sainthkh commented May 8, 2020

I guess it's simply a few millisecond difference. It usually doesn't matter to human because they're not that fast enough.

But I agree it can cause confusion. It can mean users should wait for a few seconds. I used it because waitFor is not allowed by eslint . Maybe waitFor(10) and eslint-disable might be the better choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Tests /packages/e2e-tests [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test in rich-text e2e test.
3 participants