diff --git a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCredentials.java b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCredentials.java index a024c574..ce556273 100644 --- a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCredentials.java +++ b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCredentials.java @@ -25,20 +25,15 @@ public class TestBrowserContextCredentials extends TestBase { - static boolean isChromiumHeadful() { - return isChromium() && isHeadful(); + static boolean isChromiumHeadedLike() { + // --headless=new, the default in all Chromium channels, is like headless. + return isChromium() && (isHeadful() || getBrowserChannelFromEnv() != null); } - static boolean isChromiumChannel() { - // net::ERR_INVALID_AUTH_CREDENTIALS is thrown in --headless=new which - // is the default in all Chromium channels. - return isChromium() && getBrowserChannelFromEnv() != null; - } - - @Test - @DisabledIf(value="isChromiumHeadful", disabledReason="fail") + @DisabledIf(value="isChromiumHeadedLike", disabledReason="fail") void shouldFailWithoutCredentials() { + System.out.println("channel2 " + getBrowserChannelFromEnv()); server.setAuth("/empty.html", "user", "pass"); Response response = page.navigate(server.EMPTY_PAGE); assertEquals(401, response.status()); @@ -110,6 +105,7 @@ void shouldWorkWithCorrectCredentialsAndMatchingOriginCaseInsensitive() { } @Test + @DisabledIf(value="isChromiumHeadedLike", disabledReason="fail") void shouldFailWithCorrectCredentialsAndWrongOriginScheme() { server.setAuth("/empty.html", "user", "pass"); final HttpCredentials httpCredentials = new HttpCredentials("user", "pass"); @@ -122,6 +118,7 @@ void shouldFailWithCorrectCredentialsAndWrongOriginScheme() { } @Test + @DisabledIf(value="isChromiumHeadedLike", disabledReason="fail") void shouldFailWithCorrectCredentialsAndWrongOriginHostname() { server.setAuth("/empty.html", "user", "pass"); final HttpCredentials httpCredentials = new HttpCredentials("user", "pass"); @@ -134,6 +131,7 @@ void shouldFailWithCorrectCredentialsAndWrongOriginHostname() { } @Test + @DisabledIf(value="isChromiumHeadedLike", disabledReason="fail") void shouldFailWithCorrectCredentialsAndWrongOriginPort() { server.setAuth("/empty.html", "user", "pass"); final HttpCredentials httpCredentials = new HttpCredentials("user", "pass");