playwright-java
playwright-java copied to clipboard
Added test fixture for Browser.NewContextOptions
Resolves #1781
Looks like the new tests are failing.
yea i need to figure out what's going. they pass locally for me
@yury-s can we re-run? looks like they're mostly failing to connect to the test server
Restarted the jobs.
@yury-s I'm trying to fix these tests and running into an odd issue. When the base url is set to http://localhost:9066/empty.html via
public static class CustomOptions implements OptionsFactory {
@Override
public Options getOptions() {
System.out.println("Empty Page URL: " + serverMap.get(TestFixtureContextOptions.class).EMPTY_PAGE);
return new Options()
.setApiRequestOptions(new APIRequest.NewContextOptions()
.setBaseURL(serverMap.get(TestFixtureContextOptions.class).EMPTY_PAGE))
.setContextOptions(new Browser.NewContextOptions()
.setBaseURL(serverMap.get(TestFixtureContextOptions.class).EMPTY_PAGE));
}
}
and I run page.navigate("/");
I will get the error:
23:47:52 [ERROR] TestFixtureContextOptions.testCustomBrowserContext:49 » Playwright Error {
message='Protocol error (Page.navigate): Cannot navigate to invalid URL
name='Error
stack='Error: Protocol error (Page.navigate): Cannot navigate to invalid URL
Is this not supported?
Also this only happens when I'm running all tests together.
I've verified via logging that the URL used in the options is the same as the url in the test.
Might need to do more digging. Maybe some race condition with the httpserver
Yeah, sounds like a race condition. I'd check with DEBUG=pw:protocol to see what's being sent to the browser. My hunch is that sometimes it sends just '/' instead of the the base url.