test: fix failures on firefox, webkit and windows bots
- connectOverCDP is now supported in WebKit: skip the not-chromium test there and expect the new error message - accept all close-time messages in waitForNavigation-after-disconnect - wait 2s for page errors to accumulate, mirrors upstream #38378 - regenerate firefox screenshot expectations for Firefox 151
This commit is contained in:
@@ -40,10 +40,14 @@ public class TestBrowserTypeBasic extends TestBase {
|
||||
assertEquals(getBrowserNameFromEnv(), browserType.name());
|
||||
}
|
||||
|
||||
static boolean isChromiumOrWebKit() {
|
||||
return isChromium() || isWebKit();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledIf(value="com.microsoft.playwright.TestBase#isChromium", disabledReason="Non-chromium behavior")
|
||||
@DisabledIf(value="isChromiumOrWebKit", disabledReason="Connecting over CDP is supported in Chromium and WebKit")
|
||||
void shouldThrowWhenTryingToConnectWithNotChromium() {
|
||||
PlaywrightException e = assertThrows(PlaywrightException.class, () -> browserType.connectOverCDP("foo"));
|
||||
assertTrue(e.getMessage().contains("Connecting over CDP is only supported in Chromium."));
|
||||
assertTrue(e.getMessage().contains("Connecting over CDP is only supported in Chromium and WebKit."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,9 @@ public class TestBrowserTypeConnect extends TestBase {
|
||||
}
|
||||
assertFalse(browser.isConnected());
|
||||
PlaywrightException e = assertThrows(PlaywrightException.class, () -> page.waitForNavigation(() -> {}));
|
||||
assertTrue(e.getMessage().contains("Target page, context or browser has been closed"), e.getMessage());
|
||||
assertTrue(e.getMessage().contains("Browser closed") ||
|
||||
e.getMessage().contains("Page closed") ||
|
||||
e.getMessage().contains("Target page, context or browser has been closed"), e.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -30,7 +30,7 @@ public class TestPageEventPageError extends TestBase {
|
||||
page.evaluate("async () => {\n" +
|
||||
" for (let i = 0; i < 301; i++)\n" +
|
||||
" window.setTimeout(() => { throw new Error('error' + i); }, 0);\n" +
|
||||
" await new Promise(f => window.setTimeout(f, 100));\n" +
|
||||
" await new Promise(f => window.setTimeout(f, 2000));\n" +
|
||||
" }");
|
||||
|
||||
List<String> errors = page.pageErrors();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 39 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 39 KiB |
Reference in New Issue
Block a user