E2E Tests: Await embed error placeholder size class #20668
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #19825, #20578, #18745
Relevant Slack conversation (link requires registration): https://wordpress.slack.com/archives/C02QB2JS7/p1583415961458700
This pull request seeks to attempt to improve the stability of the embeds end-to-end tests. Based on the above Slack conversation, the assumed instability is caused by a race condition between layout changes from styles and a click action by the end-to-end test code. Specifically, the
Placeholder
component uses a resize listener to apply an "element-query"-like responsive class (see #18745). Since the class is only applied after an initial render whereupon the DOM element is measured, there is a chance that a misclick may occur if those styles would result in a layout change of the Placeholder. Specifically, #20578 introduced style changes where font-size may be adjusted for the "large" variant of the placeholder, thus pushing down the "Convert to link" button that the E2E tests attempt to click.is-large
is-large
The changes included here wait for the assumed responsive class name to be applied to the Placeholder container before proceeding with the click.
Testing Instructions:
Ensure end-to-end tests pass: