File Coverage

blib/lib/Selenium/Driver/Safari.pm
Criterion Covered Total %
statement 20 31 64.5
branch n/a
condition 0 7 0.0
subroutine 7 8 87.5
pod 1 1 100.0
total 28 47 59.5


line stmt bran cond sub pod time code
1             package Selenium::Driver::Safari;
2             $Selenium::Driver::Safari::VERSION = '2.01';
3 1     1   293920 use strict;
  1         2  
  1         52  
4 1     1   7 use warnings;
  1         2  
  1         88  
5              
6 1     1   16 use v5.28;
  1         4  
7              
8 1     1   6 no warnings 'experimental';
  1         2  
  1         66  
9 1     1   9 use feature qw/signatures/;
  1         2  
  1         226  
10              
11 1     1   10 use Carp qw{confess};
  1         2  
  1         110  
12 1     1   721 use File::Which;
  1         1989  
  1         289  
13              
14             #ABSTRACT: Tell Selenium::Client how to spawn safaridriver
15              
16              
17 0     0 1   sub build_spawn_opts ( $class, $object ) {
  0            
  0            
  0            
18 0           $object->{driver_class} = $class;
19 0   0       $object->{driver_version} //= '';
20 0   0       $object->{log_file} //= "$object->{client_dir}/perl-client/selenium-$object->{port}.log";
21 0           $object->{driver_file} = File::Which::which('safaridriver');
22              
23 0           my @config = ( '--port', $object->{port} );
24              
25             # Build command string
26             $object->{command} //= [
27             $object->{driver_file},
28 0   0       @config,
29             ];
30 0           return $object;
31             }
32              
33             1;
34              
35             __END__
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Selenium::Driver::Safari - Tell Selenium::Client how to spawn safaridriver
44              
45             =head1 VERSION
46              
47             version 2.01
48              
49             =head1 Mode of Operation
50              
51             Spawns a geckodriver server on the provided port (which the caller will assign randomly)
52             Relies on geckodriver being in your $PATH
53             Pipes log output to ~/.selenium/perl-client/$port.log
54              
55             =head1 SUBROUTINES
56              
57             =head2 build_spawn_opts($class,$object)
58              
59             Builds a command string which can run the driver binary.
60             All driver classes must build this.
61              
62             =head1 SEE ALSO
63              
64             Please see those modules/websites for more information related to this module.
65              
66             =over 4
67              
68             =item *
69              
70             L<Selenium::Client|Selenium::Client>
71              
72             =back
73              
74             =head1 BUGS
75              
76             Please report any bugs or feature requests on the bugtracker website
77             L<https://github.com/troglodyne-internet-widgets/selenium-client-perl/issues>
78              
79             When submitting a bug or request, please include a test-file or a
80             patch to an existing test-file that illustrates the bug or desired
81             feature.
82              
83             =head1 AUTHORS
84              
85             Current Maintainers:
86              
87             =over 4
88              
89             =item *
90              
91             George S. Baugh <george@troglodyne.net>
92              
93             =back
94              
95             =head1 COPYRIGHT AND LICENSE
96              
97             Copyright (c) 2024 Troglodyne LLC
98              
99              
100             Permission is hereby granted, free of charge, to any person obtaining a copy
101             of this software and associated documentation files (the "Software"), to deal
102             in the Software without restriction, including without limitation the rights
103             to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
104             copies of the Software, and to permit persons to whom the Software is
105             furnished to do so, subject to the following conditions:
106             The above copyright notice and this permission notice shall be included in all
107             copies or substantial portions of the Software.
108             THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
109             IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
110             FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
111             AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
112             LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
113             OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
114             SOFTWARE.
115              
116             =cut