line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Selenium::Remote::WebElement; |
2
|
|
|
|
|
|
|
$Test::Selenium::Remote::WebElement::VERSION = '1.49'; |
3
|
|
|
|
|
|
|
# ABSTRACT: A sub-class of L, with several test-specific method additions. |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
59
|
use Moo; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
40
|
|
6
|
7
|
|
|
7
|
|
4505
|
use Sub::Install; |
|
7
|
|
|
|
|
9051
|
|
|
7
|
|
|
|
|
49
|
|
7
|
|
|
|
|
|
|
extends 'Selenium::Remote::WebElement'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=for Pod::Coverage *EVERYTHING* |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# list of test functions to be built |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has func_list => ( |
16
|
|
|
|
|
|
|
is => 'lazy', |
17
|
|
|
|
|
|
|
builder => sub { |
18
|
|
|
|
|
|
|
return [ |
19
|
33
|
|
|
33
|
|
433
|
'clear_ok', 'click_ok', 'send_keys_ok', |
20
|
|
|
|
|
|
|
'is_displayed_ok', 'is_enabled_ok', 'is_selected_ok', |
21
|
|
|
|
|
|
|
'submit_ok', 'text_is', 'text_isnt', |
22
|
|
|
|
|
|
|
'text_like', 'text_unlike', 'attribute_is', |
23
|
|
|
|
|
|
|
'attribute_isnt', 'attribute_like', 'attribute_unlike', |
24
|
|
|
|
|
|
|
'value_is', 'value_isnt', 'value_like', |
25
|
|
|
|
|
|
|
'value_unlike', 'tag_name_is', 'tag_name_isnt', |
26
|
|
|
|
|
|
|
'tag_name_like', 'tag_name_unlike' |
27
|
|
|
|
|
|
|
]; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
with 'Test::Selenium::Remote::Role::DoesTesting'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# helper so we could specify the num of args a method takes (if any) |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub has_args { |
36
|
32
|
|
|
32
|
0
|
55
|
my $self = shift; |
37
|
32
|
|
|
|
|
57
|
my $fun_name = shift; |
38
|
32
|
|
|
|
|
125
|
my $hash_fun_args = { |
39
|
|
|
|
|
|
|
'get_attribute' => 1, |
40
|
|
|
|
|
|
|
'send_keys' => 1, |
41
|
|
|
|
|
|
|
}; |
42
|
32
|
|
100
|
|
|
174
|
return ( $hash_fun_args->{$fun_name} // 0 ); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# install the test methods into the class namespace |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub BUILD { |
48
|
33
|
|
|
33
|
0
|
381
|
my $self = shift; |
49
|
33
|
|
|
|
|
53
|
foreach my $method_name ( @{ $self->func_list } ) { |
|
33
|
|
|
|
|
545
|
|
50
|
759
|
100
|
|
|
|
5711
|
unless ( defined( __PACKAGE__->can($method_name) ) ) { |
51
|
69
|
|
|
|
|
202
|
my $sub = $self->_build_sub($method_name); |
52
|
69
|
|
|
|
|
258
|
Sub::Install::install_sub( |
53
|
|
|
|
|
|
|
{ |
54
|
|
|
|
|
|
|
code => $sub, |
55
|
|
|
|
|
|
|
into => __PACKAGE__, |
56
|
|
|
|
|
|
|
as => $method_name |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |