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.47';
3 14     14   7321 use strict;
  14         33  
  14         377  
4 14     14   66 use warnings;
  14         25  
  14         336  
5              
6             # ABSTRACT: Handle construction of generic parameter finders
7 14     14   72 use Try::Tiny;
  14         23  
  14         767  
8 14     14   79 use Carp qw/carp/;
  14         34  
  14         574  
9 14     14   70 use Moo::Role;
  14         34  
  14         97  
10 14     14   7689 use namespace::clean;
  14         57437  
  14         112  
11              
12              
13             sub _build_find_by {
14 110     110   272 my ( $self, $by ) = @_;
15              
16             return sub {
17 20     20   9975 my ( $driver, $locator ) = @_;
18 20         31 my $strategy = $by;
19              
20             return try {
21 20     20   702 return $driver->find_element( $locator, $strategy );
22             }
23             catch {
24 10     10   986 carp $_;
25 10         347 return 0;
26 20         103 };
27             }
28 110         407 }
29              
30             1;
31              
32             __END__