55import org .junit .jupiter .api .AfterAll ;
66import org .junit .jupiter .api .BeforeAll ;
77import org .junit .jupiter .api .Test ;
8+ import org .junit .jupiter .api .condition .DisabledIf ;
89import org .junit .jupiter .api .io .TempDir ;
910
1011import java .io .IOException ;
@@ -88,7 +89,7 @@ public void shouldKeepSupportingHttp() {
8889 }
8990
9091 @ Test
91- public void shouldThrowWithUntrustedClientCerts () throws Exception {
92+ public void shouldThrowWithUntrustedClientCerts () {
9293 APIRequest .NewContextOptions requestOptions = new APIRequest .NewContextOptions ()
9394 .setIgnoreHTTPSErrors (true ) // TODO: remove once we can pass a custom CA.
9495 .setClientCertificates (asList (
@@ -107,7 +108,7 @@ public void shouldThrowWithUntrustedClientCerts() throws Exception {
107108 }
108109
109110 @ Test
110- public void passWithTrustedClientCertificates () throws Exception {
111+ public void passWithTrustedClientCertificates () {
111112 APIRequest .NewContextOptions requestOptions = new APIRequest .NewContextOptions ()
112113 .setIgnoreHTTPSErrors (true ) // TODO: remove once we can pass a custom CA.
113114 .setClientCertificates (asList (
@@ -125,8 +126,13 @@ public void passWithTrustedClientCertificates() throws Exception {
125126 request .dispose ();
126127 }
127128
129+ static boolean isWebKitMacOS () {
130+ return isWebKit () && isMac ;
131+ }
132+
128133 @ Test
129- public void shouldWorkWithBrowserNewContext () throws Exception {
134+ @ DisabledIf (value ="com.microsoft.playwright.TestClientCertificates#isWebKitMacOS" , disabledReason ="The network connection was lost." )
135+ public void shouldWorkWithBrowserNewContext () {
130136 Browser .NewContextOptions options = new Browser .NewContextOptions ()
131137 .setIgnoreHTTPSErrors (true ) // TODO: remove once we can pass a custom CA.
132138 .setClientCertificates (asList (
@@ -146,7 +152,8 @@ public void shouldWorkWithBrowserNewContext() throws Exception {
146152 }
147153
148154 @ Test
149- public void shouldWorkWithBrowserNewPage () throws Exception {
155+ @ DisabledIf (value ="com.microsoft.playwright.TestClientCertificates#isWebKitMacOS" , disabledReason ="The network connection was lost." )
156+ public void shouldWorkWithBrowserNewPage () {
150157 Browser .NewPageOptions options = new Browser .NewPageOptions ()
151158 .setIgnoreHTTPSErrors (true ) // TODO: remove once we can pass a custom CA.
152159 .setClientCertificates (asList (
@@ -165,7 +172,8 @@ public void shouldWorkWithBrowserNewPage() throws Exception {
165172 }
166173
167174 @ Test
168- public void shouldWorkWithBrowserLaunchPersistentContext (@ TempDir Path tmpDir ) throws Exception {
175+ @ DisabledIf (value ="com.microsoft.playwright.TestClientCertificates#isWebKitMacOS" , disabledReason ="The network connection was lost." )
176+ public void shouldWorkWithBrowserLaunchPersistentContext (@ TempDir Path tmpDir ) {
169177 BrowserType .LaunchPersistentContextOptions options = new BrowserType .LaunchPersistentContextOptions ()
170178 .setIgnoreHTTPSErrors (true ) // TODO: remove once we can pass a custom CA.
171179 .setClientCertificates (asList (
0 commit comments