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: Intermittent problem on block transforms tests. #15485

Merged
merged 1 commit into from May 8, 2019

Conversation

Projects
None yet
2 participants
@jorgefilipecosta
Copy link
Member

commented May 7, 2019

Description

@gziolo noticed that the block-transforms end to end tests failed on https://travis-ci.com/WordPress/gutenberg/jobs/198177156#L1081, without an apparent reason for the failure.
It seems the test had an intermittent problem, where fails are very rare. Locally, I never managed to reproduce the problem.
Watching the error available in https://travis-ci.com/WordPress/gutenberg/jobs/198177156#L1081 it seems everything went as expected and the right selectors were clicked (otherwise the selector unmatch would be reported as error), but the block was not transformed.
Checking the code we notice the following two lines:

	await transformBlockTo( transformName );
	return getEditedPostContent();

And inside transformBlockTo we see:

....
	await page.click( `.block-editor-block-types-list__item[aria-label="${ name }"]` );

I think the click to transform was executed with success, but the content change was not processed immediately and getEditedPostContent() still returned the content before the block was transformed.
In this PR we add a wait for selector call at the end of transformBlockTo, that makes the function wait for the new block to appear.

How has this been tested?

Verify the end 2 end test packages/e2e-test-utils/src/transform-block-to.js executes with success.

@gziolo

gziolo approved these changes May 8, 2019

Copy link
Member

left a comment

@jorgefilipecosta, many thanks for working on this fix. Much appreciated 🙇

@gziolo gziolo merged commit 885f32e into master May 8, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@gziolo gziolo added this to the 5.7 (Gutenberg) milestone May 8, 2019

@gziolo gziolo deleted the fix/interimitent-problem-block-transforms-test branch May 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.