From bcf6336e22632cc10121bdb74b6385a40b47c2b0 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Fri, 30 Oct 2020 15:13:23 +0800 Subject: [PATCH 1/2] Ignore when axe core fails to inject into blank iframes --- .../e2e-tests/config/setup-test-framework.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/e2e-tests/config/setup-test-framework.js b/packages/e2e-tests/config/setup-test-framework.js index eabeb0fe38da4..6a5a517480799 100644 --- a/packages/e2e-tests/config/setup-test-framework.js +++ b/packages/e2e-tests/config/setup-test-framework.js @@ -145,6 +145,22 @@ function observeConsoleLogging() { return; } + // Ignore axe core errors about injections into blank iframes + // See the following tickets for details: + // - https://github.com/dequelabs/axe-puppeteer/issues/25 + // - https://github.com/dequelabs/axe-core-npm/issues/98 + // + // Previous attempts to solve: + // - https://github.com/WordPress/gutenberg/pull/26527 + // - https://github.com/WordPress/gutenberg/pull/26535 + if ( + text.includes( + 'Failed to inject axe-core into frame (about:blank)' + ) + ) { + return; + } + const logFunction = OBSERVED_CONSOLE_MESSAGE_TYPES[ type ]; // As of Puppeteer 1.6.1, `message.text()` wrongly returns an object of From 06a2d355b4062f1ba7a1049f7b01ffe0ec20ee3a Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Mon, 2 Nov 2020 15:25:24 +0800 Subject: [PATCH 2/2] Try handling multiple args --- packages/e2e-tests/config/setup-test-framework.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/e2e-tests/config/setup-test-framework.js b/packages/e2e-tests/config/setup-test-framework.js index 6a5a517480799..38e95dd149c81 100644 --- a/packages/e2e-tests/config/setup-test-framework.js +++ b/packages/e2e-tests/config/setup-test-framework.js @@ -154,8 +154,10 @@ function observeConsoleLogging() { // - https://github.com/WordPress/gutenberg/pull/26527 // - https://github.com/WordPress/gutenberg/pull/26535 if ( - text.includes( - 'Failed to inject axe-core into frame (about:blank)' + message.args.some( ( argument ) => + argument?.includes( + 'Failed to inject axe-core into frame (about:blank)' + ) ) ) { return;