2020import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
2121import static org .assertj .core .api .AssertionsForClassTypes .assertThat ;
2222import static org .openqa .selenium .testing .Safely .safelyCall ;
23- import static org .openqa .selenium .testing .drivers .Browser .CHROME ;
2423import static org .openqa .selenium .testing .drivers .Browser .EDGE ;
2524import static org .openqa .selenium .testing .drivers .Browser .IE ;
2625import static org .openqa .selenium .testing .drivers .Browser .SAFARI ;
@@ -323,7 +322,6 @@ void canCallFunctionWithOwnershipNone() {
323322 @ NotYetImplemented (SAFARI )
324323 @ NotYetImplemented (IE )
325324 @ NotYetImplemented (EDGE )
326- @ NotYetImplemented (CHROME )
327325 void canCallFunctionThatThrowsException () {
328326 String id = driver .getWindowHandle ();
329327 Script script = new Script (id , driver );
@@ -342,8 +340,7 @@ void canCallFunctionThatThrowsException() {
342340
343341 EvaluateResultExceptionValue exception = (EvaluateResultExceptionValue ) result ;
344342 assertThat (exception .getExceptionDetails ().getException ().getType ()).isEqualTo ("error" );
345- assertThat (exception .getExceptionDetails ().getText ())
346- .isEqualTo ("SyntaxError: expected expression, got ')'" );
343+ assertThat (exception .getExceptionDetails ().getText ()).contains ("SyntaxError:" );
347344 assertThat (exception .getExceptionDetails ().getLineNumber ()).isPositive ();
348345 assertThat (exception .getExceptionDetails ().getColumnNumber ()).isPositive ();
349346 assertThat (exception .getExceptionDetails ().getStacktrace ().getCallFrames ().size ()).isEqualTo (0 );
0 commit comments