Skip to content

Commit

Permalink
Playwright Utils: Silence some of the warnings coming from Firefox (#…
Browse files Browse the repository at this point in the history
…61451)


Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
  • Loading branch information
3 people authored May 10, 2024
1 parent e3eab49 commit 5915f9a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions packages/e2e-test-utils-playwright/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ function observeConsoleLogging( message: ConsoleMessage ) {
// See: https://core.trac.wordpress.org/ticket/37000
// See: https://www.chromestatus.com/feature/5088147346030592
// See: https://www.chromestatus.com/feature/5633521622188032
if ( text.includes( 'A cookie associated with a cross-site resource' ) ) {
if (
text.includes( 'A cookie associated with a cross-site resource' ) ||
text.includes(
'https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite'
)
) {
return;
}

Expand Down Expand Up @@ -93,14 +98,25 @@ function observeConsoleLogging( message: ConsoleMessage ) {
return;
}

// https://bugzilla.mozilla.org/show_bug.cgi?id=1404468
if (
text.includes( 'Layout was forced before the page was fully loaded' )
) {
return;
}

// Deprecated warnings coming from the third-party libraries.
if ( text.includes( 'MouseEvent.moz' ) ) {
return;
}

const logFunction =
type as ( typeof OBSERVED_CONSOLE_MESSAGE_TYPES )[ number ];

// Disable reason: We intentionally bubble up the console message
// which, unless the test explicitly anticipates the logging via
// @wordpress/jest-console matchers, will cause the intended test
// failure.

// eslint-disable-next-line no-console
console[ logFunction ]( text );
}
Expand Down

0 comments on commit 5915f9a

Please sign in to comment.