Skip to content

Commit

Permalink
Testing: Skip test failures for font decoding warnings (#15502)
Browse files Browse the repository at this point in the history
* Testing: Skip test failures for font decoding warnings

* Testing: Fix Classic block Add Media toolbar button click
  • Loading branch information
aduth authored May 8, 2019
1 parent cdfb97c commit 17c3571
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/e2e-test-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

- The minimum version of Gutenberg `5.6.0` or the minimum version of WordPress `5.2.0`.

### Bug Fixes

- WordPress 5.2: Fix a false positive build failure caused by Dashicons font file.
- WordPress 5.2: Fix a test failure for Classic Block media insertion caused by a change in tooltips text ([rWP45066](https://core.trac.wordpress.org/changeset/45066)).

## 1.1.0 (2019-03-20)

### New Features
Expand Down
13 changes: 13 additions & 0 deletions packages/e2e-tests/config/setup-test-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ function observeConsoleLogging() {
return;
}

// A bug present in WordPress 5.2 will produce console warnings when
// loading the Dashicons font. These can be safely ignored, as they do
// not otherwise regress on application behavior. This logic should be
// removed once the associated ticket has been closed.
//
// See: https://core.trac.wordpress.org/ticket/47183
if (
text.startsWith( 'Failed to decode downloaded font:' ) ||
text.startsWith( 'OTS parsing error:' )
) {
return;
}

const logFunction = OBSERVED_CONSOLE_MESSAGE_TYPES[ type ];

// As of Puppeteer 1.6.1, `message.text()` wrongly returns an object of
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/specs/blocks/classic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ describe( 'Classic', () => {
await page.keyboard.type( 'test' );

// Click the image button.
await page.waitForSelector( 'div[aria-label="Add Media"]' );
await page.click( 'div[aria-label="Add Media"]' );
await page.waitForSelector( 'div[aria-label^="Add Media"]' );
await page.click( 'div[aria-label^="Add Media"]' );

// Wait for media modal to appear and upload image.
await page.waitForSelector( '.media-modal input[type=file]' );
Expand Down

0 comments on commit 17c3571

Please sign in to comment.