lib/Selenium/Driver/Safari.pm

filter: Statementstmt 75.8% 22 / 29 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 63.8% 30 / 47 CC 4 SCAR 20.7
CC
4
Cov
63%
build_spawn_opts
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.9
« lib/Selenium/Driver/Chrome.pm ↑ Summary script/build_selenium_spec.pl »
1 package Selenium::Driver::Safari;
2 1 $Selenium::Driver::Safari::VERSION = '1.06';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use v5.28;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶no warnings 'experimental';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use feature qw/signatures/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Carp qw{confess};
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use File::Which;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 #ABSTRACT: Tell Selenium::Client how to spawn safaridriver
15  
16  
17 ▶sub build_spawn_opts($class,$object) {
Subroutine build_spawn_opts: not called CC=4 SCAR=30.0
Pod documented
18 0 $object->{driver_class} = $class;
19 0 ▶ $object->{driver_version} //= '';
Condition0%0/2
$object->{"driver_version"} //= ""
l!l
00
MC/DC0%0/1
$object->{"driver_version"} //= ""
$object->{"driver_version"}
Truth table0%0/2
A
A= $object->{"driver_version"}
Aresult
11
00
20 0 ▶ $object->{log_file} //= "$object->{client_dir}/perl-client/selenium-$object->{port}.log";
Condition0%0/2
$object->{"log_file"} //= qq[$object->{"client_dir"}/perl-client/selenium-$object->{"port"}.log]
l!l
00
MC/DC0%0/1
$object->{"log_file"} //= qq[$object->{"client_dir"}/perl-client/selenium-$object->{"port"}.log]
$object->{"log_file"}
Truth table0%0/2
A
A= $object->{"log_file"}
Aresult
11
00
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 ▶ @config,
Condition0%0/2
$object->{"command"} //= [$object->{"driver_file"}, @config]
l!l
00
MC/DC0%0/1
$object->{"command"} //= [$object->{"driver_file"}, @config]
$object->{"command"}
Truth table0%0/2
A
A= $object->{"command"}
Aresult
11
00
29 ];
30 0 return $object;
31 }
32  
33 1 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 1.06
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 AUTHOR
63  
64 George S. Baugh <george@troglodyne.net>
65  
66 =head1 COPYRIGHT AND LICENSE
67  
68 This software is Copyright (c) 2023 by George S. Baugh.
69  
70 This is free software, licensed under:
71  
72 The MIT (X11) License
73  
74 =cut
« lib/Selenium/Driver/Chrome.pm ↑ Summary script/build_selenium_spec.pl »