Selenium/Remote/Finders.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 100% 38 / 38 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Selenium/Remote/Driver/Firefox/Profile.pm ↑ Summary Selenium/Remote/WDKeys.pm »
1 package Selenium::Remote::Finders;
2 27 $Selenium::Remote::Finders::VERSION = '1.50';
3 27 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 27 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: Handle construction of generic parameter finders
7 27 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 27 ▶use Carp qw/carp/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 27 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 27 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13 110 ▶sub _build_find_by {
Subroutine _build_find_by: called CC=1 SCAR=0.0
14 110 my ( $self, $by ) = @_;
15  
16 20 ▶ return sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
17 20 my ( $driver, $locator ) = @_;
18 20 my $strategy = $by;
19  
20 20 ▶ return try {
Subroutine __ANON__: called CC=1 SCAR=0.0
21 20 return $driver->find_element( $locator, $strategy );
22 }
23 10 ▶ catch {
Subroutine __ANON__: called CC=1 SCAR=0.0
24 10 carp $_;
25 10 return 0;
26 20 };
27 }
28 110 }
29  
30 27 1;
31  
32 __END__
« Selenium/Remote/Driver/Firefox/Profile.pm ↑ Summary Selenium/Remote/WDKeys.pm »