lib/Selenium/Driver/Auto.pm

filter: Statementstmt 53.8% 14 / 26 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 47.5% 19 / 40 CC 5 SCAR 28.4
CC
5
Cov
41%
build_spawn_opts
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 17.1
« lib/Selenium/Driver/SeleniumHQ/Jar.pm ↑ Summary lib/Selenium/Subclass.pm »
1 package Selenium::Driver::Auto;
2 1 $Selenium::Driver::Auto::VERSION = '1.06';
3 #ABSTRACT: Automatically choose the best driver available for your browser choice
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Carp qw{confess};
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use File::Which;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 # Abstract: Automatically figure out which driver you want
12  
13  
14 sub build_spawn_opts {
15 # Uses object call syntax
16 0 ▶ my (undef,$object) = @_;
Subroutine build_spawn_opts: not called CC=5 SCAR=34.0
Pod documented
17  
18 0 ▶ if ($object->{browser} eq 'firefox') {
Branch: 4 branches
BranchTrueFalseTotal
if ($object->{'browser'} eq 'firefox') { } 0 0 0
elsif ($object->{'browser'} eq 'chrome') { } 0 0 0
elsif ($object->{'browser'} eq 'MicrosoftEdge') { } 0 0 0
elsif ($object->{'browser'} eq 'safari') { } 0 0 0
19 0 require Selenium::Driver::Gecko;
20 0 return Selenium::Driver::Gecko->build_spawn_opts($object);
21 } elsif ($object->{browser} eq 'chrome') {
22 0 require Selenium::Driver::Chrome;
23 0 return Selenium::Driver::Chrome->build_spawn_opts($object);
24 } elsif ($object->{browser} eq 'MicrosoftEdge') {
25 0 require Selenium::Driver::Edge;
26 0 return Selenium::Driver::Edge->build_spawn_opts($object);
27 } elsif ($object->{browser} eq 'safari') {
28 0 require Selenium::Driver::Safari;
29 0 return Selenium::Driver::Safari->build_spawn_opts($object);
30 }
31 0 require Selenium::Driver::SeleniumHQ::Jar;
32 0 return Selenium::Driver::SeleniumHQ::Jar->build_spawn_opts($object);
33 }
34  
35 1 1;
36  
37 __END__
38  
39 =pod
40  
41 =encoding UTF-8
42  
43 =head1 NAME
44  
45 Selenium::Driver::Auto - Automatically choose the best driver available for your browser choice
46  
47 =head1 VERSION
48  
49 version 1.06
50  
51 =head1 SUBROUTINES
52  
53 =head2 build_spawn_opts($class,$object)
54  
55 Builds a command string which can run the driver binary.
56 All driver classes must build this.
57  
58 =head1 AUTHOR
59  
60 George S. Baugh <george@troglodyne.net>
61  
62 =head1 COPYRIGHT AND LICENSE
63  
64 This software is Copyright (c) 2023 by George S. Baugh.
65  
66 This is free software, licensed under:
67  
68 The MIT (X11) License
69  
70 =cut
« lib/Selenium/Driver/SeleniumHQ/Jar.pm ↑ Summary lib/Selenium/Subclass.pm »