Browse Source

Test::Selenium::Remote::Role::DoesTesting - better description for send_keys()

Eric Johnson 11 years ago
parent
commit
a7ddc9d92f
1 changed files with 10 additions and 7 deletions
  1. 10 7
      lib/Test/Selenium/Remote/Role/DoesTesting.pm

+ 10 - 7
lib/Test/Selenium/Remote/Role/DoesTesting.pm

@@ -40,20 +40,23 @@ sub _check_method {
 # main method for _ok tests
 # main method for _ok tests
 
 
 sub _check_ok {
 sub _check_ok {
-    my $self      = shift;
-    my $method      = shift;
-    my @args = @_;
-    my $rv;
+    my $self   = shift;
+    my $method = shift;
+    my @args   = @_;
+    my ($rv, $num_of_args, @r_args);
     try {
     try {
-        my $num_of_args = $self->has_args($method);
-        my @r_args = splice( @args, 0, $num_of_args );
+        $num_of_args = $self->has_args($method);
+        @r_args = splice( @args, 0, $num_of_args );
         $rv = $self->$method(@r_args);
         $rv = $self->$method(@r_args);
     }
     }
     catch {
     catch {
         $self->croak($_);
         $self->croak($_);
     };
     };
 
 
-    my $test_name = pop @args // $method;
+    my $default_test_name = $method;
+    $default_test_name .= join(" ", @r_args) if $num_of_args > 0;
+
+    my $test_name = pop @args // $default_test_name;
     return $self->ok( $rv, $test_name);
     return $self->ok( $rv, $test_name);
 }
 }