WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.5k stars 4.19k forks source link

E2E tests: Revisit typewriter test. #23351

Open jasmussen opened 4 years ago

jasmussen commented 4 years ago

From https://github.com/WordPress/gutenberg/pull/22213#discussion_r443408438

22213 changes the padding of the editing canvas to be smaller. This leaves more room for themes that don't add this padding themselves, i.e. 2020 which is being used for these tests.

The tests failing were:

Both were tested using npm run test-e2e packages/e2e-tests/specs/edi tor/various/typewriter.test.js -- --puppeteer-interactive. This revealed that the change in padding caused the typewrite test to fail, because suddenly there was enough room on the canvas for the blocks to fit there without invoking the scrollbar.

It was fixed by adding more blocks in the tests.

But it does suggest that this particular test is very sensitive to things style properties like padding, margin, line-height and font size. For example if TwentyTwenty updates the editor style to add this padding back, or to change a block margin, this test will likely fail again.

We should look at a way to make this test more resilient to styles.

noisysocks commented 2 years ago

Probably a good idea to look at moving this test to Playwright too while we're at it.

jasmussen commented 1 year ago

@ellatrix @noisysocks is this issue still relevant?

ellatrix commented 7 months ago

Not sure if the test has changed after the migration cc @Mamaduka

Mamaduka commented 7 months ago

@ellatrix, very little. Primary changes made during migrates were to improve locators and make them more resilient.