|
@@ -555,10 +555,10 @@ UPLOAD: {
|
|
|
|
|
|
|
|
ERROR: {
|
|
ERROR: {
|
|
|
# driver behaviour on error
|
|
# driver behaviour on error
|
|
|
- $driver->error_handler(sub { my ($self,$error_msg) = @_; croak("Got message: $error_msg");});
|
|
|
|
|
- like( exception { $driver->find_element("somethingthatdoesnotexist") }, qr/^Got message:/, "Error handler catches correctly an error");
|
|
|
|
|
|
|
+ $driver->error_handler(sub {my ($self,$error_msg) = @_; croak("Got message: $error_msg");});
|
|
|
|
|
+ like( exception { $driver->accept_alert }, qr/^Got message:/, "Error handler catches correctly an error");
|
|
|
$driver->clear_error_handler;
|
|
$driver->clear_error_handler;
|
|
|
- unlike( exception { $driver->find_element("somethingthatdoesnotexist") }, qr/^Got message:/, "Error handler was correctly cleared");
|
|
|
|
|
|
|
+ unlike( exception { $driver->accept_alert }, qr/^Got message:/, "Error handler was correctly cleared");
|
|
|
|
|
|
|
|
like( exception { $driver->error_handler( 'hello' ) }, qr/must be a code ref/, 'we only accept code refs as error handlers');
|
|
like( exception { $driver->error_handler( 'hello' ) }, qr/must be a code ref/, 'we only accept code refs as error handlers');
|
|
|
}
|
|
}
|