Răsfoiți Sursa

Added describe element command

  - the return value of 'describe' for an element has not yet
    been defined.  the test will be modified when it has been
Gordon Child 14 ani în urmă
părinte
comite
9f55d2a1c1
2 a modificat fișierele cu 16 adăugiri și 0 ștergeri
  1. 14 0
      lib/Selenium/Remote/WebElement.pm
  2. 2 0
      t/02-webelement-live.t

+ 14 - 0
lib/Selenium/Remote/WebElement.pm

@@ -435,6 +435,20 @@ sub hover {
     return $self->_execute_command($res);
 }
 
+=head2 describe
+
+ Description:
+    Describe the identified element
+
+ Usage:
+    $elem->describe();
+
+=cut
+sub describe {
+    my ($self) = @_;
+    my $res = { 'command' => 'describeElement', 'id' => $self->{id} };
+    return $self->_execute_command($res);
+}
 
 1;
 

+ 2 - 0
t/02-webelement-live.t

@@ -67,6 +67,8 @@ INPUT: {
             $ret = $elem->is_selected();
             is($ret, 'false', 'Toggle & Checkbox is selected');
             };
+            note "describe return data has not yet been defined";
+            ok($elem->describe,"describe returns data");
        }
 
 MODIFIER: {