@@ -79,7 +79,15 @@ public async Task ShouldFailWhenServerReturns204()
7979 } ) ;
8080 var exception = await Assert . ThrowsAnyAsync < PuppeteerException > (
8181 ( ) => Page . GoToAsync ( TestConstants . EmptyPage ) ) ;
82- Assert . Contains ( "net::ERR_ABORTED" , exception . Message ) ;
82+
83+ if ( TestConstants . IsChrome )
84+ {
85+ Assert . Contains ( "net::ERR_ABORTED" , exception . Message ) ;
86+ }
87+ else
88+ {
89+ Assert . Contains ( "NS_BINDING_ABORTED" , exception . Message ) ;
90+ }
8391 }
8492
8593 [ Fact ]
@@ -118,7 +126,15 @@ public async Task ShouldNavigateToEmptyPage(WaitUntilNavigation waitUntil)
118126 public async Task ShouldFailWhenNavigatingToBadUrl ( )
119127 {
120128 var exception = await Assert . ThrowsAnyAsync < Exception > ( async ( ) => await Page . GoToAsync ( "asdfasdf" ) ) ;
121- Assert . Contains ( "Cannot navigate to invalid URL" , exception . Message ) ;
129+
130+ if ( TestConstants . IsChrome )
131+ {
132+ Assert . Contains ( "Cannot navigate to invalid URL" , exception . Message ) ;
133+ }
134+ else
135+ {
136+ Assert . Contains ( "Invalid url" , exception . Message ) ;
137+ }
122138 }
123139
124140 [ Fact ]
@@ -129,21 +145,45 @@ public async Task ShouldFailWhenNavigatingToBadSSL()
129145 Page . RequestFailed += ( sender , e ) => Assert . NotNull ( e . Request ) ;
130146
131147 var exception = await Assert . ThrowsAnyAsync < Exception > ( async ( ) => await Page . GoToAsync ( TestConstants . HttpsPrefix + "/empty.html" ) ) ;
132- Assert . Contains ( "net::ERR_CERT_AUTHORITY_INVALID" , exception . Message ) ;
148+
149+ if ( TestConstants . IsChrome )
150+ {
151+ Assert . Contains ( "net::ERR_CERT_AUTHORITY_INVALID" , exception . Message ) ;
152+ }
153+ else
154+ {
155+ Assert . Contains ( "SSL_ERROR_UNKNOWN" , exception . Message ) ;
156+ }
133157 }
134158
135159 [ Fact ]
136160 public async Task ShouldFailWhenNavigatingToBadSSLAfterRedirects ( )
137161 {
138162 var exception = await Assert . ThrowsAnyAsync < Exception > ( async ( ) => await Page . GoToAsync ( TestConstants . HttpsPrefix + "/redirect/2.html" ) ) ;
139- Assert . Contains ( "net::ERR_CERT_AUTHORITY_INVALID" , exception . Message ) ;
163+
164+ if ( TestConstants . IsChrome )
165+ {
166+ Assert . Contains ( "net::ERR_CERT_AUTHORITY_INVALID" , exception . Message ) ;
167+ }
168+ else
169+ {
170+ Assert . Contains ( "SSL_ERROR_UNKNOWN" , exception . Message ) ;
171+ }
140172 }
141173
142174 [ Fact ]
143175 public async Task ShouldFailWhenMainResourcesFailedToLoad ( )
144176 {
145177 var exception = await Assert . ThrowsAnyAsync < Exception > ( async ( ) => await Page . GoToAsync ( "http://localhost:44123/non-existing-url" ) ) ;
146- Assert . Contains ( "net::ERR_CONNECTION_REFUSED" , exception . Message ) ;
178+
179+ if ( TestConstants . IsChrome )
180+ {
181+ Assert . Contains ( "net::ERR_CONNECTION_REFUSED" , exception . Message ) ;
182+ }
183+ else
184+ {
185+ Assert . Contains ( "NS_ERROR_CONNECTION_REFUSED" , exception . Message ) ;
186+ }
147187 }
148188
149189 [ Fact ]
0 commit comments