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

Tests: Fix failing block hierarchy navigation e2e test #15247

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Apr 29, 2019

Description

Originally reported in #15241 (comment)

There is an unrelated issue with e2e test:

https://travis-ci.com/WordPress/gutenberg/jobs/196208309#L1161

FAIL specs/block-hierarchy-navigation.test.js (7.863s)
  ● Navigating the block hierarchy › should navigate block hierarchy using only the keyboard
    expect(received).toMatchSnapshot()
    Snapshot name: `Navigating the block hierarchy should navigate block hierarchy using only the keyboard 1`
    - Snapshot
    + Received
    @@ -9,9 +9,13 @@
      <div class="wp-block-column"></div>
      <!-- /wp:column -->
      
      <!-- wp:column -->
      <div class="wp-block-column"><!-- wp:paragraph -->
    - <p>Third column</p>
    + <p></p>
      <!-- /wp:paragraph --></div>
      <!-- /wp:column --></div>
    - <!-- /wp:columns -->"
    + <!-- /wp:columns -->
    + 
    + <!-- wp:image -->
    + <figure class="wp-block-image"><img alt=""/></figure>
    + <!-- /wp:image -->"
      80 | 		await page.keyboard.type( 'Third column' );
      81 | 
    > 82 | 		expect( await getEditedPostContent() ).toMatchSnapshot();
         | 		                                       ^
      83 | 	} );
      84 | 
      85 | 	it( 'should appear and function even without nested blocks', async () => {
      at Object.toMatchSnapshot (specs/block-hierarchy-navigation.test.js:82:42)
      at tryCatch (../../node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (../../node_modules/regenerator-runtime/runtime.js:288:22)
      at Generator.prototype.(anonymous function) [as next] (../../node_modules/regenerator-runtime/runtime.js:114:21)
      at asyncGeneratorStep (specs/block-hierarchy-navigation.test.js:9:103)
      at _next (specs/block-hierarchy-navigation.test.js:11:194)

It looks like it's an easy fix. Missing await seems to be the root cause.

How has this been tested?

With the local Docker setup up and running (./bin/setup-local-env.sh):

for i in {1..20}; do npx wp-scripts test-e2e --config packages/e2e-tests/jest.config.js packages/e2e-tests/specs/block-hierarchy-navigation.test.js; done;

@gziolo gziolo self-assigned this Apr 29, 2019
@gziolo gziolo added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Bug An existing feature does not function as intended labels Apr 29, 2019
@gziolo gziolo added this to the 5.6 (Gutenberg) milestone Apr 29, 2019
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Related: #14219 (Seems I'd missed this one)

@gziolo gziolo merged commit 3426fff into master Apr 29, 2019
@gziolo gziolo deleted the fix/failing-block-hierarchy-navigation-test branch April 29, 2019 12:19
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. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants