Browse Source

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 năm trước cách đây
mục cha
commit
9f55d2a1c1
2 tập tin đã thay đổi với 16 bổ sung0 xóa
  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: {