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

Projects
None yet
3 participants
@jorgefilipecosta
Member

jorgefilipecosta commented Aug 27, 2018

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.

jorgefilipecosta and others added some commits Aug 27, 2018

@tofumatt

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' );

This comment has been minimized.

@gziolo

gziolo Aug 28, 2018

Member

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?

@gziolo

gziolo Aug 28, 2018

Member

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?

This comment has been minimized.

@jorgefilipecosta

jorgefilipecosta Aug 28, 2018

Member

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.

@jorgefilipecosta

jorgefilipecosta Aug 28, 2018

Member

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.

This comment has been minimized.

@gziolo

gziolo Aug 28, 2018

Member

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

@gziolo

gziolo Aug 28, 2018

Member

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

@jorgefilipecosta jorgefilipecosta merged commit 6259b23 into master Aug 29, 2018

2 checks passed

codecov/project 50.58% remains the same compared to 18f45f9
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jorgefilipecosta jorgefilipecosta deleted the add/e2e-test-font-size-picker-logic branch Aug 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment