Navigation Menu

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: Wait for the Publish button to not be disabled #50653

Merged
merged 3 commits into from Mar 3, 2021

Conversation

WunderBart
Copy link
Member

@WunderBart WunderBart commented Mar 2, 2021

This should fix some flakiness around publishing posts. When the editor performs autosave, the Publish buttons get disabled until the save request is done. These buttons are not technically disabled though (meaning they're still clickable), as only the aria-disabled attribute is being set. As a result, the clickWhenClickable() helper clicks a "disabled" button, then nothing happens and the test fails. The clickWhenClickable() helper does not address these kinds of situations (doesn't check whether an element is disabled in any way), so we're fixing this issue by using a more explicit selector and waiting for the button to not be disabled. Whether clickWhenClickable() should address these kinds of situations can be discussed in a follow-up PR.

Also, I'm reverting the scripted click hack as the fix from #39205 doesn't seem to be necessary anymore.

@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Mar 2, 2021

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.

@WunderBart WunderBart force-pushed the refactor/e2e-tweaks-part-003 branch from a7d5072 to 407ab7c Compare March 2, 2021 13:08
@WunderBart WunderBart self-assigned this Mar 2, 2021
@WunderBart WunderBart marked this pull request as ready for review March 2, 2021 13:31
@WunderBart WunderBart added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 2, 2021
Copy link
Contributor

@griffbrad griffbrad left a comment

Choose a reason for hiding this comment

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

👍🏻LGTM. Great catch!

Base automatically changed from refactor/e2e-tweaks-part-001 to trunk March 3, 2021 13:16
This should fix some flakiness around publishing posts. Sometimes, when the publish panel opens, the editor performs autosave at the same time, which disables the Publish button until the save request is done. The button is not technically `disabled` (meaning it's still clickable) as it only uses the `aria-disabled` attribute. As a result, the "disabled" button gets clicked and nothing happens. The `clickWhenClickable()` helper does not address these kinds of situations (doesn't check whether an element is disabled in any way), so we're fixing this issue by using a more explicit selector and waiting for the button to not be disabled. Whether `clickWhenClickable()` should address these kinds of situations can be discussed in a follow-up PR.

Also, I'm replacing the scripted click hack as the fix from #39205 doesn't seem to be necessary anymore.
@WunderBart WunderBart force-pushed the refactor/e2e-tweaks-part-003 branch from 593c1f0 to 93a7c84 Compare March 3, 2021 13:29
It's the same situation as with the Publish button - it's clicked while being disabled by the autosave request.
@WunderBart WunderBart force-pushed the refactor/e2e-tweaks-part-003 branch from 93a7c84 to 4fcf4f4 Compare March 3, 2021 13:30
@WunderBart WunderBart added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 3, 2021
@WunderBart WunderBart merged commit 4cc54bc into trunk Mar 3, 2021
@WunderBart WunderBart deleted the refactor/e2e-tweaks-part-003 branch March 3, 2021 14:36
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.

None yet

3 participants