chore: unflake TestBrowserContextProxy.shouldExcludePatterns (#1404)

This commit is contained in:
Yury Semikhatsky 2023-10-11 15:23:46 -07:00 committed by GitHub
parent 91e70280a3
commit db1c899cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,17 +175,33 @@ public class TestBrowserContextProxy extends TestBase {
// @see https://gist.github.com/CollinChaffin/24f6c9652efb3d6d5ef2f5502720ef00
.setBypass("1.non.existent.domain.for.the.test, 2.non.existent.domain.for.the.test, .another.test")));
Page page = context.newPage();
page.navigate("http://0.non.existent.domain.for.the.test/target.html");
assertEquals("Served by the proxy", page.title());
assertThrows(PlaywrightException.class, () -> page.navigate("http://1.non.existent.domain.for.the.test/target.html"));
assertThrows(PlaywrightException.class, () -> page.navigate("http://2.non.existent.domain.for.the.test/target.html"));
assertThrows(PlaywrightException.class, () -> page.navigate("http://foo.is.the.another.test/target.html"));
page.navigate("http://3.non.existent.domain.for.the.test/target.html");
assertEquals("Served by the proxy", page.title());
{
Page page = context.newPage();
page.navigate("http://0.non.existent.domain.for.the.test/target.html");
assertEquals("Served by the proxy", page.title());
page.close();
}
{
Page page = context.newPage();
assertThrows(PlaywrightException.class, () -> page.navigate("http://1.non.existent.domain.for.the.test/target.html"));
page.close();
}
{
Page page = context.newPage();
assertThrows(PlaywrightException.class, () -> page.navigate("http://2.non.existent.domain.for.the.test/target.html"));
page.close();
}
{
Page page = context.newPage();
assertThrows(PlaywrightException.class, () -> page.navigate("http://foo.is.the.another.test/target.html"));
page.close();
}
{
Page page = context.newPage();
page.navigate("http://3.non.existent.domain.for.the.test/target.html");
assertEquals("Served by the proxy", page.title());
page.close();
}
context.close();
}