File Coverage

blib/lib/Selenium/Remote/Finders.pm
Criterion Covered Total %
statement 26 26 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod n/a
total 36 36 100.0


line stmt bran cond sub pod time code
1             package Selenium::Remote::Finders;
2             $Selenium::Remote::Finders::VERSION = '1.50';
3 27     27   310773 use strict;
  27         141  
  27         1199  
4 27     27   282 use warnings;
  27         103  
  27         1967  
5              
6             # ABSTRACT: Handle construction of generic parameter finders
7 27     27   867 use Try::Tiny;
  27         2941  
  27         2526  
8 27     27   192 use Carp qw/carp/;
  27         276  
  27         1674  
9 27     27   706 use Moo::Role;
  27         20079  
  27         309  
10 27     27   29220 use namespace::clean;
  27         364454  
  27         276  
11              
12              
13             sub _build_find_by {
14 110     110   202 my ( $self, $by ) = @_;
15              
16             return sub {
17 20     20   18953 my ( $driver, $locator ) = @_;
18 20         49 my $strategy = $by;
19              
20             return try {
21 20     20   1215 return $driver->find_element( $locator, $strategy );
22             }
23             catch {
24 10     10   1343 carp $_;
25 10         150 return 0;
26 20         185 };
27             }
28 110         459 }
29              
30             1;
31              
32             __END__