line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebDriver::Tiny::Elements 0.105; |
2
|
|
|
|
|
|
|
|
3
|
41
|
|
|
41
|
|
1252
|
use 5.020; |
|
41
|
|
|
|
|
156
|
|
4
|
41
|
|
|
41
|
|
234
|
use feature qw/postderef signatures/; |
|
41
|
|
|
|
|
85
|
|
|
41
|
|
|
|
|
4148
|
|
5
|
41
|
|
|
41
|
|
244
|
use warnings; |
|
41
|
|
|
|
|
83
|
|
|
41
|
|
|
|
|
1331
|
|
6
|
41
|
|
|
41
|
|
619
|
no warnings 'experimental'; |
|
41
|
|
|
|
|
110
|
|
|
41
|
|
|
|
|
47836
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Manip |
9
|
2
|
|
|
2
|
1
|
17
|
sub append { bless [ shift->@*, map @$_[ 1.. $#$_ ], @_ ] } |
10
|
1
|
|
|
1
|
1
|
90
|
sub first { bless [ $_[0]->@[ 0, 1 ] ] } |
11
|
1
|
|
|
1
|
1
|
7
|
sub last { bless [ $_[0]->@[ 0, -1 ] ] } |
12
|
1
|
|
|
1
|
1
|
3
|
sub size { $#{ $_[0] } } |
|
1
|
|
|
|
|
7
|
|
13
|
6
|
|
|
6
|
1
|
17
|
sub slice { my ( $drv, @ids ) = shift->@*; bless [ $drv, @ids[@_] ] } |
|
6
|
|
|
|
|
31
|
|
14
|
3
|
|
|
3
|
1
|
8
|
sub split { my ( $drv, @ids ) = $_[0]->@*; map { bless [ $drv, $_ ] } @ids } |
|
3
|
|
|
|
|
9
|
|
|
10
|
|
|
|
|
26
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
1
|
2
|
sub uniq($self) { |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
17
|
1
|
|
|
|
|
2
|
my ( $drv, @ids ) = @$self; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
3
|
bless [ $drv, keys %{ { map { $_ => undef } @ids } } ]; |
|
1
|
|
|
|
|
2
|
|
|
11
|
|
|
|
|
45
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
1
|
96
|
sub attr($self, $value) { $self->_req( GET => "/attribute/$value" ) } |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
23
|
1
|
|
|
1
|
1
|
82
|
sub css($self, $value) { $self->_req( GET => "/css/$value" ) } |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
24
|
1
|
|
|
1
|
0
|
70
|
sub prop($self, $value) { $self->_req( GET => "/property/$value" ) } |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
1
|
525
|
sub clear($self) { $self->_req( POST => '/clear' ); $self } |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
5
|
|
27
|
1
|
|
|
1
|
1
|
466
|
sub click($self) { $self->_req( POST => '/click' ); $self } |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
3
|
|
28
|
1
|
|
|
1
|
1
|
475
|
sub tap($self) { $self->_req( POST => '/tap' ); $self } |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
1
|
1
|
89
|
sub enabled($self) { $self->_req( GET => '/enabled' ) } |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
31
|
1
|
|
|
1
|
1
|
67
|
sub rect($self) { $self->_req( GET => '/rect' ) } |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
32
|
1
|
|
|
1
|
1
|
79
|
sub selected($self) { $self->_req( GET => '/selected' ) } |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
33
|
1
|
|
|
1
|
1
|
84
|
sub tag($self) { $self->_req( GET => '/name' ) } |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
34
|
1
|
|
|
1
|
1
|
118
|
sub visible($self) { $self->_req( GET => '/displayed' ) } |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
1
|
1
|
20922
|
sub html { $_[0][0]->js( 'return arguments[0].outerHTML', $_[0] ) } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
*find = \&WebDriver::Tiny::find; |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
1
|
1
|
908
|
sub screenshot($self, $file = undef) { |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
41
|
1
|
|
|
|
|
7
|
require MIME::Base64; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
5
|
my $data = MIME::Base64::decode_base64( |
44
|
|
|
|
|
|
|
$self->_req( GET => '/screenshot' ) |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
1
|
50
|
|
|
|
5
|
if ( defined $file ) { |
48
|
0
|
0
|
|
|
|
0
|
open my $fh, '>', $file or die $!; |
49
|
0
|
|
|
|
|
0
|
print $fh $data; |
50
|
0
|
0
|
|
|
|
0
|
close $fh or die $!; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
0
|
return $self; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
3
|
$data; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
1
|
1
|
89
|
sub send_keys($self, $keys) { |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
59
|
1
|
|
|
|
|
8
|
$self->_req( POST => '/value', { text => "$keys" } ); |
60
|
1
|
|
|
|
|
4
|
$self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
0
|
1
|
0
|
sub text($self) { |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
64
|
0
|
|
|
|
|
0
|
my ( $drv, @ids ) = @$self; |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
0
|
join ' ', map $drv->_req( GET => "/element/$_/text" ), @ids; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Call driver's ->_req, prepend "/element/:id" to the path first. |
70
|
13
|
|
|
13
|
|
147
|
sub _req { $_[0][0]->_req( $_[1], "/element/$_[0][1]$_[2]", $_[3] ) } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |