| 1 | package Selenium::Client::WebElement; | ||||||||||||||||||||||||||||||||||
| 2 | 2 | $Selenium::Client::WebElement::VERSION = '2.01'; | |||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Representation of an HTML Element used by Selenium Client Driver | ||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use parent qw{Selenium::Remote::WebElement}; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | no warnings qw{experimental}; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use feature qw{signatures}; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||
| 13 | 2 | ▶ | use Carp::Always; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | sub _param ( $self, $default, $param, $value = undef ) { | ||||||||||||||||||||||||||||||||
|
Subroutine
_param: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | $self->{$param} //= $default; | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
$self->{$param} //= $default
MC/DC0%0/2
$self->{$param} //= $default
$self->{$param}
$default
Truth table0%0/3
A //= B
A= $self->{$param}B= $default
| |||||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | $self->{$param} = $value if defined $value; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 19 | 0 | return $self->{$param}; | |||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub element ( $self, $element = undef ) { | ||||||||||||||||||||||||||||||||
|
Subroutine
element: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 23 | 0 | return $self->_param( undef, 'element', $element ); | |||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub driver ( $self, $driver = undef ) { | ||||||||||||||||||||||||||||||||
|
Subroutine
driver: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 27 | 0 | return $self->_param( undef, 'driver', $driver ); | |||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | sub session ( $self, $session = undef ) { | ||||||||||||||||||||||||||||||||
|
Subroutine
session: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 31 | 0 | return $self->_param( undef, 'session', $session ); | |||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | sub new ( $class, %options ) { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 35 | 0 | my $self = bless( $options{id}, $class ); | |||||||||||||||||||||||||||||||||
| 36 | 0 | $self->id( $self->{elementid} ); | |||||||||||||||||||||||||||||||||
| 37 | 0 | $self->driver( $options{driver} ); | |||||||||||||||||||||||||||||||||
| 38 | 0 | $self->session( $options{driver}->session ); | |||||||||||||||||||||||||||||||||
| 39 | 0 | return $self; | |||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub id ( $self, $value = undef ) { | ||||||||||||||||||||||||||||||||
|
Subroutine
id: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 43 | 0 | return $self->_param( undef, 'id', $value ); | |||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||
| 46 | # We need to inject the element ID due to this nonstandard wrapper. | ||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | sub _execute_command ( $self, $res, $params = {} ) { | ||||||||||||||||||||||||||||||||
|
Subroutine
_execute_command: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||
| 49 | #XXX sigh, some day spec authors will stop LYING | ||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | $params->{propertyname} //= delete $params->{property_name} // delete $res->{property_name}; | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
$params->{"propertyname"} //= delete $params->{"property_name"} // delete $res->{"property_name"}
delete $params->{"property_name"} // delete $res->{"property_name"}
MC/DC0%0/3
$params->{"propertyname"} //= delete $params->{"property_name"} // delete $res->{"property_name"}
$params->{"propertyname"}
delete $params->{"property_name"}
delete $res->{"property_name"}
Truth table0%0/4
A //= B // C
A= $params->{"propertyname"}B= delete $params->{"property_name"}C= delete $res->{"property_name"}
| |||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||
| 52 | 0 | my $params_modified = { | |||||||||||||||||||||||||||||||||
| 53 | %$params, | ||||||||||||||||||||||||||||||||||
| 54 | elementid => $self->id, | ||||||||||||||||||||||||||||||||||
| 55 | }; | ||||||||||||||||||||||||||||||||||
| 56 | 0 | return $self->driver->_execute_command( $res, $params_modified ); | |||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||
| 59 | 2 | 1; | |||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||||||||||||||||