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

Add end 2 end test to font size to font choosing mechanism. #9380

Merged
merged 3 commits into from
Aug 29, 2018

Conversation

jorgefilipecosta
Copy link
Member

Description

Until now, we had no end 2 end test testing the font size choosing logic and we were unable to catch some problems as #9191.

This PR adds a set of the end 2 end tests that test if the font size choosing mechanism is working correctly.

How has this been tested?

I checked that the new end 2 end tests pass and I introduced some bugs on purpose ( eg.: the revert of https://github.com/WordPress/gutenberg/pull/9253/files) and verified they fail.

Copy link
Member

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

Nice! I tweaked a few minor grammar things but the code looks good. 🚢

@tofumatt tofumatt added this to the 3.7 milestone Aug 28, 2018
await clickBlockAppender();
await page.keyboard.type( 'Paragraph to be made "small"' );

await page.click( '.blocks-font-size .components-range-control__number' );
Copy link
Member

Choose a reason for hiding this comment

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

if the logic between lines 92 and 100 won't work, this test will still pass. The same applies to other tests which reset the font size. Do you have an idea how to mitigate it?

Copy link
Member Author

@jorgefilipecosta jorgefilipecosta Aug 28, 2018

Choose a reason for hiding this comment

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

Hi @gziolo to mitigate this problem, we have very similar tests containing the part where we set the font size. So if lines 92-100 don't work this test will pass but the tests where we set the font size are going to fail because the logic is the same. In summary, if lines 92-100 don't work it means the setting of the font size is not working, and we are testing that.
Another approach would be to use the data-layer functions to insert the block with the font size already set. But even this approach is not perfect if the block was not created correctly, the test may still pass wrongly.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds reasonable 👍 I wasn’t aware that it is tested in other place

@jorgefilipecosta jorgefilipecosta merged commit 6259b23 into master Aug 29, 2018
@jorgefilipecosta jorgefilipecosta deleted the add/e2e-test-font-size-picker-logic branch August 29, 2018 11:37
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.

3 participants