|
@@ -33,7 +33,7 @@ has func_list => (
|
|
|
'send_modifier_ok', 'accept_alert_ok', 'dismiss_alert_ok',
|
|
'send_modifier_ok', 'accept_alert_ok', 'dismiss_alert_ok',
|
|
|
'get_ok', 'go_back_ok', 'go_forward_ok', 'add_cookie_ok',
|
|
'get_ok', 'go_back_ok', 'go_forward_ok', 'add_cookie_ok',
|
|
|
'get_page_source_ok', 'find_element_ok', 'find_elements_ok',
|
|
'get_page_source_ok', 'find_element_ok', 'find_elements_ok',
|
|
|
- 'find_child_element_ok', 'find_child_elements_ok',
|
|
|
|
|
|
|
+ 'find_child_element_ok', 'find_child_elements_ok', 'find_no_element_ok',
|
|
|
'compare_elements_ok', 'click_ok', 'double_click_ok',
|
|
'compare_elements_ok', 'click_ok', 'double_click_ok',
|
|
|
'body_like',
|
|
'body_like',
|
|
|
];
|
|
];
|
|
@@ -44,8 +44,12 @@ sub has_args {
|
|
|
my $self = shift;
|
|
my $self = shift;
|
|
|
my $fun_name = shift;
|
|
my $fun_name = shift;
|
|
|
my $hash_fun_args = {
|
|
my $hash_fun_args = {
|
|
|
- 'find_element' => 1,
|
|
|
|
|
- 'find_elements' => 1,
|
|
|
|
|
|
|
+ 'find_element' => 2,
|
|
|
|
|
+ 'find_no_element' => 2,
|
|
|
|
|
+ 'find_child_element' => 3,
|
|
|
|
|
+ 'find_child_elements' => 3,
|
|
|
|
|
+ 'find_element' => 2,
|
|
|
|
|
+ 'find_elements' => 2,
|
|
|
'compare_elements' => 2,
|
|
'compare_elements' => 2,
|
|
|
'get' => 1,
|
|
'get' => 1,
|
|
|
};
|
|
};
|
|
@@ -235,66 +239,173 @@ more documentation, see the related test methods in L<Selenium::Remote::Driver>
|
|
|
|
|
|
|
|
click_ok
|
|
click_ok
|
|
|
double_click_ok
|
|
double_click_ok
|
|
|
|
|
+=cut
|
|
|
|
|
+
|
|
|
|
|
|
|
|
-=head2 $twd->type_element_ok($search_target, $keys, [, $desc ]);
|
|
|
|
|
|
|
+# function composing a find_element with locator with a webelement test
|
|
|
|
|
|
|
|
- $twd->type_element_ok( $search_target, $keys [, $desc ] );
|
|
|
|
|
|
|
+sub _find_element_with_action {
|
|
|
|
|
+ my $self = shift;
|
|
|
|
|
+ my $method = shift;
|
|
|
|
|
+ my ($locator,$locator_strategy,$params,$desc) = @_;
|
|
|
|
|
+ # case 4 args
|
|
|
|
|
+ if ($desc) {
|
|
|
|
|
+ $self->croak('Invalid locator strategy') unless ($self->FINDERS->{$locator_strategy});
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ if ($params) {
|
|
|
|
|
+ # means that we called it the 'old way' (no locator strategy)
|
|
|
|
|
+ if (!defined($self->FINDERS->{$locator_strategy})) {
|
|
|
|
|
+ $desc = $params;
|
|
|
|
|
+ $params = $locator_strategy;
|
|
|
|
|
+ $locator_strategy = $self->default_finder;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ # means it was called with no locator strategy and no desc
|
|
|
|
|
+ if ($locator_strategy) {
|
|
|
|
|
+ if (!defined($self->FINDERS->{$locator_strategy})) {
|
|
|
|
|
+ $params = $locator_strategy;
|
|
|
|
|
+ $locator_strategy = $self->default_finder;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ $self->croak('Not enough arguments');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ unless ($desc) {
|
|
|
|
|
+ $desc = $method;
|
|
|
|
|
+ $desc .= "'" . join( " ", ($params // '') ) . "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ return $self->find_element($locator,$locator_strategy)->$method( $params, $desc );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+=head2 $twd->type_element_ok($search_target [,$locator], $keys, [, $desc ]);
|
|
|
|
|
+
|
|
|
|
|
+ $twd->type_element_ok( $search_target [,$locator], $keys [, $desc ] );
|
|
|
|
|
|
|
|
Use L<Selenium::Remote::Driver/find_element> to resolve the C<$search_target>
|
|
Use L<Selenium::Remote::Driver/find_element> to resolve the C<$search_target>
|
|
|
-to a web element, and then type C<$keys> into it, providing an optional test
|
|
|
|
|
|
|
+to a web element and an optional locator, and then type C<$keys> into it, providing an optional test
|
|
|
label.
|
|
label.
|
|
|
|
|
|
|
|
-Currently, other finders besides the default are not supported for C<type_ok()>.
|
|
|
|
|
|
|
|
|
|
=cut
|
|
=cut
|
|
|
|
|
|
|
|
sub type_element_ok {
|
|
sub type_element_ok {
|
|
|
my $self = shift;
|
|
my $self = shift;
|
|
|
- my $locator = shift;
|
|
|
|
|
- my $keys = shift;
|
|
|
|
|
- my $desc = shift;
|
|
|
|
|
- return $self->find_element($locator)->send_keys_ok( $keys, $desc );
|
|
|
|
|
|
|
+ my $method = 'send_keys_ok';
|
|
|
|
|
+ return $self->_find_element_with_action($method,@_);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+=head2 $twd->element_text_is($search_target[,$finder],$expected_text [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+ $twd->element_text_is($search_target[,$finder],$expected_text [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+=cut
|
|
|
|
|
+
|
|
|
|
|
+sub element_text_is {
|
|
|
|
|
+ my $self = shift;
|
|
|
|
|
+ my $method = 'text_is';
|
|
|
|
|
+ return $self->_find_element_with_action($method,@_);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+=head2 $twd->element_value_is($search_target[,$finder],$expected_value [,$desc]);
|
|
|
|
|
|
|
|
-=head2 $twd->find_element_ok($search_target [, $desc ]);
|
|
|
|
|
|
|
+ $twd->element_value_is($search_target[,$finder],$expected_value [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+=cut
|
|
|
|
|
|
|
|
- $twd->find_element_ok( $search_target [, $desc ] );
|
|
|
|
|
|
|
+sub element_value_is {
|
|
|
|
|
+ my $self = shift;
|
|
|
|
|
+ my $method = 'value_is';
|
|
|
|
|
+ return $self->_find_element_with_action($method,@_);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+=head2 $twd->click_element_ok($search_target [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+ $twd->click_element_ok($search_target [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+Find an element and then click on it.
|
|
|
|
|
+
|
|
|
|
|
+=cut
|
|
|
|
|
+
|
|
|
|
|
+sub click_element_ok {
|
|
|
|
|
+ my $self = shift;
|
|
|
|
|
+ my $method = 'click_ok';
|
|
|
|
|
+ return $self->_find_element_with_action($method,@_);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+=head2 $twd->clear_element_ok($search_target [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+ $twd->clear_element_ok($search_target [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+Find an element and then clear on it.
|
|
|
|
|
+
|
|
|
|
|
+=cut
|
|
|
|
|
+
|
|
|
|
|
+sub clear_element_ok {
|
|
|
|
|
+ my $self = shift;
|
|
|
|
|
+ my $method = 'clear_ok';
|
|
|
|
|
+ return $self->_find_element_with_action($method,@_);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+=head2 $twd->is_element_displayed_ok($search_target [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+ $twd->is_element_displayed_ok($search_target [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+Find an element and check to confirm that it is displayed. (visible)
|
|
|
|
|
+
|
|
|
|
|
+=cut
|
|
|
|
|
+
|
|
|
|
|
+sub is_element_displayed_ok {
|
|
|
|
|
+ my $self = shift;
|
|
|
|
|
+ my $method = 'is_displayed_ok';
|
|
|
|
|
+ return $self->_find_element_with_action($method,@_);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+=head2 $twd->is_element_enabled_ok($search_target [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+ $twd->is_element_enabled_ok($search_target [,$desc]);
|
|
|
|
|
+
|
|
|
|
|
+Find an element and check to confirm that it is enabled.
|
|
|
|
|
+
|
|
|
|
|
+=cut
|
|
|
|
|
+
|
|
|
|
|
+sub is_element_enabled_ok {
|
|
|
|
|
+ my $self = shift;
|
|
|
|
|
+ my $method = 'is_enabled_ok';
|
|
|
|
|
+ return $self->_find_element_with_action($method,@_);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+=head2 $twd->find_element_ok($search_target [,$finder, $desc ]);
|
|
|
|
|
+
|
|
|
|
|
+ $twd->find_element_ok( $search_target [,$finder, $desc ] );
|
|
|
|
|
|
|
|
Returns true if C<$search_target> is successfully found on the page. L<$search_target>
|
|
Returns true if C<$search_target> is successfully found on the page. L<$search_target>
|
|
|
-is passed to L<Selenium::Remote::Driver/find_element> using the C<default_finder>. See
|
|
|
|
|
-there for more details on the format. Currently, other finders besides the default are not supported
|
|
|
|
|
-for C<find_element_ok()>.
|
|
|
|
|
|
|
+is passed to L<Selenium::Remote::Driver/find_element> using a finder or the C<default_finder>
|
|
|
|
|
+if none passed.
|
|
|
|
|
+See there for more details on the format for C<find_element_ok()>.
|
|
|
|
|
|
|
|
=cut
|
|
=cut
|
|
|
|
|
|
|
|
# Eventually, it would be nice to support other finds like Test::WWW::Selenium does, like this:
|
|
# Eventually, it would be nice to support other finds like Test::WWW::Selenium does, like this:
|
|
|
# 'xpath=//foo', or 'css=.foo', etc.
|
|
# 'xpath=//foo', or 'css=.foo', etc.
|
|
|
|
|
|
|
|
-=head2 $twd->find_no_element_ok($search_target [, $desc ]);
|
|
|
|
|
|
|
+=head2 $twd->find_no_element_ok($search_target [,$finder, $desc ]);
|
|
|
|
|
|
|
|
- $twd->find_no_element_ok( $search_target [, $desc ] );
|
|
|
|
|
|
|
+ $twd->find_no_element_ok( $search_target [,$finder, $desc ] );
|
|
|
|
|
|
|
|
Returns true if C<$search_target> is I<not> found on the page. L<$search_target>
|
|
Returns true if C<$search_target> is I<not> found on the page. L<$search_target>
|
|
|
-is passed to L<Selenium::Remote::Driver/find_element> using the C<default_finder>. See
|
|
|
|
|
-there for more details on the format. Currently, other finders besides the default are not supported
|
|
|
|
|
|
|
+is passed to L<Selenium::Remote::Driver/find_element> using a finder or the
|
|
|
|
|
+C<default_finder> if none passed.See there for more details on the format.
|
|
|
for C<find_no_element_ok()>.
|
|
for C<find_no_element_ok()>.
|
|
|
|
|
|
|
|
=cut
|
|
=cut
|
|
|
|
|
|
|
|
-sub find_no_element_ok {
|
|
|
|
|
- my $self = shift;
|
|
|
|
|
- my $search_target = shift;
|
|
|
|
|
- my $desc = shift;
|
|
|
|
|
- my $rv = 0 ;
|
|
|
|
|
- local $Test::Builder::Level = $Test::Builder::Level + 1;
|
|
|
|
|
- try {
|
|
|
|
|
- $self->find_element($search_target)
|
|
|
|
|
- } catch {
|
|
|
|
|
- $rv = 1 if ($_);
|
|
|
|
|
- };
|
|
|
|
|
- return $self->ok($rv == 1,$desc);
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
=head2 $twd->content_like( $regex [, $desc ] )
|
|
=head2 $twd->content_like( $regex [, $desc ] )
|
|
|
|
|
|
|
@@ -349,18 +460,17 @@ sub content_unlike {
|
|
|
my $self = shift;
|
|
my $self = shift;
|
|
|
my $regex = shift;
|
|
my $regex = shift;
|
|
|
my $desc = shift;
|
|
my $desc = shift;
|
|
|
-
|
|
|
|
|
local $Test::Builder::Level = $Test::Builder::Level + 1;
|
|
local $Test::Builder::Level = $Test::Builder::Level + 1;
|
|
|
|
|
|
|
|
my $content = $self->get_page_source();
|
|
my $content = $self->get_page_source();
|
|
|
|
|
|
|
|
if ( not ref $regex eq 'ARRAY' ) {
|
|
if ( not ref $regex eq 'ARRAY' ) {
|
|
|
- my $desc = qq{Content is unlike "$regex"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Content is unlike "$regex"} if ( not defined $desc );
|
|
|
return unlike_string( $content, $regex, $desc );
|
|
return unlike_string( $content, $regex, $desc );
|
|
|
}
|
|
}
|
|
|
elsif ( ref $regex eq 'ARRAY' ) {
|
|
elsif ( ref $regex eq 'ARRAY' ) {
|
|
|
for my $re (@$regex) {
|
|
for my $re (@$regex) {
|
|
|
- my $desc = qq{Content is unlike "$re"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Content is unlike "$re"} if ( not defined $desc );
|
|
|
unlike_string( $content, $re, $desc );
|
|
unlike_string( $content, $re, $desc );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -393,12 +503,12 @@ sub body_text_like {
|
|
|
my $text = $self->get_body();
|
|
my $text = $self->get_body();
|
|
|
|
|
|
|
|
if ( not ref $regex eq 'ARRAY' ) {
|
|
if ( not ref $regex eq 'ARRAY' ) {
|
|
|
- my $desc = qq{Text is like "$regex"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Text is like "$regex"} if ( not defined $desc );
|
|
|
return like_string( $text, $regex, $desc );
|
|
return like_string( $text, $regex, $desc );
|
|
|
}
|
|
}
|
|
|
elsif ( ref $regex eq 'ARRAY' ) {
|
|
elsif ( ref $regex eq 'ARRAY' ) {
|
|
|
for my $re (@$regex) {
|
|
for my $re (@$regex) {
|
|
|
- my $desc = qq{Text is like "$re"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Text is like "$re"} if ( not defined $desc );
|
|
|
like_string( $text, $re, $desc );
|
|
like_string( $text, $re, $desc );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -431,12 +541,12 @@ sub body_text_unlike {
|
|
|
my $text = $self->get_body();
|
|
my $text = $self->get_body();
|
|
|
|
|
|
|
|
if ( not ref $regex eq 'ARRAY' ) {
|
|
if ( not ref $regex eq 'ARRAY' ) {
|
|
|
- my $desc = qq{Text is unlike "$regex"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Text is unlike "$regex"} if ( not defined $desc );
|
|
|
return unlike_string( $text, $regex, $desc );
|
|
return unlike_string( $text, $regex, $desc );
|
|
|
}
|
|
}
|
|
|
elsif ( ref $regex eq 'ARRAY' ) {
|
|
elsif ( ref $regex eq 'ARRAY' ) {
|
|
|
for my $re (@$regex) {
|
|
for my $re (@$regex) {
|
|
|
- my $desc = qq{Text is unlike "$re"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Text is unlike "$re"} if ( not defined $desc );
|
|
|
unlike_string( $text, $re, $desc );
|
|
unlike_string( $text, $re, $desc );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -468,12 +578,12 @@ sub content_contains {
|
|
|
my $content = $self->get_page_source();
|
|
my $content = $self->get_page_source();
|
|
|
|
|
|
|
|
if ( not ref $str eq 'ARRAY' ) {
|
|
if ( not ref $str eq 'ARRAY' ) {
|
|
|
- my $desc = qq{Content contains "$str"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Content contains "$str"} if ( not defined $desc );
|
|
|
return contains_string( $content, $str, $desc );
|
|
return contains_string( $content, $str, $desc );
|
|
|
}
|
|
}
|
|
|
elsif ( ref $str eq 'ARRAY' ) {
|
|
elsif ( ref $str eq 'ARRAY' ) {
|
|
|
for my $s (@$str) {
|
|
for my $s (@$str) {
|
|
|
- my $desc = qq{Content contains "$s"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Content contains "$s"} if ( not defined $desc );
|
|
|
contains_string( $content, $s, $desc );
|
|
contains_string( $content, $s, $desc );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -503,12 +613,12 @@ sub content_lacks {
|
|
|
my $content = $self->get_page_source();
|
|
my $content = $self->get_page_source();
|
|
|
|
|
|
|
|
if ( not ref $str eq 'ARRAY' ) {
|
|
if ( not ref $str eq 'ARRAY' ) {
|
|
|
- my $desc = qq{Content lacks "$str"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Content lacks "$str"} if ( not defined $desc );
|
|
|
return lacks_string( $content, $str, $desc );
|
|
return lacks_string( $content, $str, $desc );
|
|
|
}
|
|
}
|
|
|
elsif ( ref $str eq 'ARRAY' ) {
|
|
elsif ( ref $str eq 'ARRAY' ) {
|
|
|
for my $s (@$str) {
|
|
for my $s (@$str) {
|
|
|
- my $desc = qq{Content lacks "$s"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Content lacks "$s"} if ( not defined $desc );
|
|
|
lacks_string( $content, $s, $desc );
|
|
lacks_string( $content, $s, $desc );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -541,12 +651,12 @@ sub body_text_contains {
|
|
|
my $text = $self->get_body();
|
|
my $text = $self->get_body();
|
|
|
|
|
|
|
|
if ( not ref $str eq 'ARRAY' ) {
|
|
if ( not ref $str eq 'ARRAY' ) {
|
|
|
- my $desc = qq{Text contains "$str"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Text contains "$str"} if ( not defined $desc );
|
|
|
return contains_string( $text, $str, $desc );
|
|
return contains_string( $text, $str, $desc );
|
|
|
}
|
|
}
|
|
|
elsif ( ref $str eq 'ARRAY' ) {
|
|
elsif ( ref $str eq 'ARRAY' ) {
|
|
|
for my $s (@$str) {
|
|
for my $s (@$str) {
|
|
|
- my $desc = qq{Text contains "$s"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Text contains "$s"} if ( not defined $desc );
|
|
|
contains_string( $text, $s, $desc );
|
|
contains_string( $text, $s, $desc );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -579,90 +689,17 @@ sub body_text_lacks {
|
|
|
my $text = $self->get_body();
|
|
my $text = $self->get_body();
|
|
|
|
|
|
|
|
if ( not ref $str eq 'ARRAY' ) {
|
|
if ( not ref $str eq 'ARRAY' ) {
|
|
|
- my $desc = qq{Text is lacks "$str"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Text is lacks "$str"} if ( not defined $desc );
|
|
|
return lacks_string( $text, $str, $desc );
|
|
return lacks_string( $text, $str, $desc );
|
|
|
}
|
|
}
|
|
|
elsif ( ref $str eq 'ARRAY' ) {
|
|
elsif ( ref $str eq 'ARRAY' ) {
|
|
|
for my $s (@$str) {
|
|
for my $s (@$str) {
|
|
|
- my $desc = qq{Text is lacks "$s"} if ( not defined $desc );
|
|
|
|
|
|
|
+ $desc = qq{Text is lacks "$s"} if ( not defined $desc );
|
|
|
lacks_string( $text, $s, $desc );
|
|
lacks_string( $text, $s, $desc );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-=head2 $twd->element_text_is($search_target,$expected_text [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
- $twd->element_text_is($search_target,$expected_text [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
-=cut
|
|
|
|
|
-
|
|
|
|
|
-sub element_text_is {
|
|
|
|
|
- my ( $self, $search_target, $expected, $desc ) = @_;
|
|
|
|
|
- return $self->find_element($search_target)->text_is( $expected, $desc );
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-=head2 $twd->element_value_is($search_target,$expected_value [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
- $twd->element_value_is($search_target,$expected_value [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
-=cut
|
|
|
|
|
-
|
|
|
|
|
-sub element_value_is {
|
|
|
|
|
- my ( $self, $search_target, $expected, $desc ) = @_;
|
|
|
|
|
- return $self->find_element($search_target)->value_is( $expected, $desc );
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-=head2 $twd->click_element_ok($search_target [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
- $twd->click_element_ok($search_target [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
-Find an element and then click on it.
|
|
|
|
|
-
|
|
|
|
|
-=cut
|
|
|
|
|
-
|
|
|
|
|
-sub click_element_ok {
|
|
|
|
|
- my ( $self, $search_target, $desc ) = @_;
|
|
|
|
|
- return $self->find_element($search_target)->click_ok($desc);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-=head2 $twd->clear_element_ok($search_target [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
- $twd->clear_element_ok($search_target [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
-Find an element and then clear on it.
|
|
|
|
|
-
|
|
|
|
|
-=cut
|
|
|
|
|
-
|
|
|
|
|
-sub clear_element_ok {
|
|
|
|
|
- my ( $self, $search_target, $desc ) = @_;
|
|
|
|
|
- return $self->find_element($search_target)->clear_ok($desc);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-=head2 $twd->is_element_displayed_ok($search_target [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
- $twd->is_element_displayed_ok($search_target [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
-Find an element and check to confirm that it is displayed. (visible)
|
|
|
|
|
-
|
|
|
|
|
-=cut
|
|
|
|
|
-
|
|
|
|
|
-sub is_element_displayed_ok {
|
|
|
|
|
- my ( $self, $search_target, $desc ) = @_;
|
|
|
|
|
- return $self->find_element($search_target)->is_displayed_ok($desc);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-=head2 $twd->is_element_enabled_ok($search_target [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
- $twd->is_element_enabled_ok($search_target [,$desc]);
|
|
|
|
|
-
|
|
|
|
|
-Find an element and check to confirm that it is enabled.
|
|
|
|
|
-
|
|
|
|
|
-=cut
|
|
|
|
|
-
|
|
|
|
|
-sub is_element_enabled_ok {
|
|
|
|
|
- my ( $self, $search_target, $desc ) = @_;
|
|
|
|
|
- return $self->find_element($search_target)->is_enabled_ok($desc);
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
1;
|
|
1;
|
|
|
|
|
|