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 committed May 16, 2019
1 parent 72539b8 commit c8dc17d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
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 @@ -123,6 +123,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 c8dc17d

Please sign in to comment.