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

Update E2E tests for Twenty Twenty theme #17566

Merged
merged 6 commits into from
Sep 25, 2019
Merged

Update E2E tests for Twenty Twenty theme #17566

merged 6 commits into from
Sep 25, 2019

Conversation

noisysocks
Copy link
Member

@noisysocks noisysocks commented Sep 25, 2019

Update the E2E tests to work with the new Twenty Twenty theme in trunk.

  • ● Heading › it should correctly apply named colors
  • ● TypeWriter › should maintain caret position after scroll
  • ● TypeWriter › should scroll caret into view from the top
  • ● Font Size Picker › should apply a named font size using the font size input
  • ● Preview with Custom Fields enabled › displays edits to the post title and content in the preview
  • ● Managing reusable blocks › Should import reusable blocks

@noisysocks noisysocks marked this pull request as ready for review September 25, 2019 05:49
@noisysocks noisysocks added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Sep 25, 2019
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Great work on this!

@noisysocks noisysocks merged commit bf1ca07 into master Sep 25, 2019
@noisysocks noisysocks deleted the fix/e2e-failures branch September 25, 2019 06:02
@@ -16,7 +16,7 @@ describe( 'Managing reusable blocks', () => {
* @return {Promise} Promise resolving to number of post list entries.
*/
async function getNumberOfEntries() {
return page.evaluate( () => document.querySelectorAll( '.entry' ).length );
return page.evaluate( () => document.querySelectorAll( '.hentry' ).length );
Copy link
Member

Choose a reason for hiding this comment

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

.hentry? 🙃

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I'm not really sure how this ever worked. The rows in the Manage All Blocks screen have class hentry. We could maybe consider selecting .type-wp_block instead.

Screen Shot 2019-09-25 at 16 17 24

@gziolo
Copy link
Member

gziolo commented Sep 25, 2019

Congrats for making Travis happy again 💯

@ellatrix
Copy link
Member

What typewriter tests were failing?

@noisysocks
Copy link
Member Author

What typewriter tests were failing?

These two:

  • TypeWriter › should maintain caret position after scroll
  • TypeWriter › should scroll caret into view from the top

Both failures were to do with the default font size changing. This meant that there wasn't a scrollable container on the page. Would appreciate you double checking the changes in this PR to make sure I didn't bugger it up 🙂

@ellatrix
Copy link
Member

@noisysocks I'm not sure if they have to do with the font size change. Some of the tests are now changed and don't test the correct thing anymore. E.g. the scroll test should happen at the very start, not after the page has already been scrolled. Something is going wrong because in the e2e test there is no scroll container.

@ellatrix
Copy link
Member

Screenshot 2019-09-26 at 19 09 56

The container has now a much smaller width, so because of the styles it's not scrollable.

@ellatrix
Copy link
Member

I'm not sure why that whitespace is there...

@noisysocks
Copy link
Member Author

Thanks for checking! Looks like I did indeed bugger it up 🙂

That margin is very strange. Does it appear when you run Gutenberg normally? Is it something to do with the WP Admin menu being collapsed?

@youknowriad youknowriad added this to the Gutenberg 6.6 milestone Sep 30, 2019
epiqueras pushed a commit that referenced this pull request Sep 30, 2019
* Update 'Heading › it should correctly apply named colors' test for Twenty Twenty

* Update 'TypeWriter' tests for Twenty Twenty

* Update 'Font Size Picker › should apply a named font size using the font size input' test for Twenty Twenty

* Update 'Preview with Custom Fields enabled › displays edits to the post title and content in the preview' test for Twenty Twenty

* Fix 'Managing reusable blocks › Should import reusable blocks' test

* TypeWriter E2E tests: Use <= instead of <
youknowriad pushed a commit that referenced this pull request Oct 15, 2019
* Update 'Heading › it should correctly apply named colors' test for Twenty Twenty

* Update 'TypeWriter' tests for Twenty Twenty

* Update 'Font Size Picker › should apply a named font size using the font size input' test for Twenty Twenty

* Update 'Preview with Custom Fields enabled › displays edits to the post title and content in the preview' test for Twenty Twenty

* Fix 'Managing reusable blocks › Should import reusable blocks' test

* TypeWriter E2E tests: Use <= instead of <
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants