diff --git a/lib/Test/Selenium/Remote/Role/DoesTesting.pm b/lib/Test/Selenium/Remote/Role/DoesTesting.pm index 2f3d0c30..e10cd5e4 100644 --- a/lib/Test/Selenium/Remote/Role/DoesTesting.pm +++ b/lib/Test/Selenium/Remote/Role/DoesTesting.pm @@ -114,11 +114,16 @@ sub _check_ok { } }; - my $default_test_name = $method; - $default_test_name .= "'" . join( "' ", @r_args ) . "'" - if $num_of_args > 0; - - my $test_name = pop @args // $default_test_name; + # test description might have been explicitly passed + my $test_name = pop @args; + + # generic test description when no explicit test description was passed + if ( ! defined $test_name ) { + $test_name = $num_of_args > 0 ? + join( ' ', $method, map { q{'$_'} } @r_args ) + : + $method; + } # case when find_no_element found an element, we should croak if ( $method eq 'find_no_element' ) {