| 1 | package Selenium::Driver::WinApp; | ||||||||||||
| 2 | 1 | $Selenium::Driver::WinApp::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 | ▶ | no warnings 'experimental'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use feature qw/signatures/; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 1 | ▶ | use Carp qw{confess}; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | 1 | ▶ | use File::Which; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | |||||||||||||
| 12 | #ABSTRACT: Tell Selenium::Client how to spawn the Windows Application Driver | ||||||||||||
| 13 | |||||||||||||
| 14 | |||||||||||||
| 15 | sub _driver { | ||||||||||||
| 16 | 0 | ▶ | return 'WinAppDriver.exe'; | ||||||||||
|
Subroutine
_driver: not called CC=1 SCAR=6.9
| |||||||||||||
| 17 | } | ||||||||||||
| 18 | |||||||||||||
| 19 | ▶ | sub build_spawn_opts($class,$object) { | |||||||||||
|
Subroutine
build_spawn_opts: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||
| 20 | 0 | $object->{driver_class} = $class; | |||||||||||
| 21 | 0 | ▶ | $object->{driver_version} //= ''; | ||||||||||
|
Condition0%0/2
$object->{"driver_version"} //= ""
MC/DC0%0/1
$object->{"driver_version"} //= ""
$object->{"driver_version"}
Truth table0%0/2
A
A= $object->{"driver_version"}
| |||||||||||||
| 22 | 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]
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"}
| |||||||||||||
| 23 | 0 | $object->{driver_file} = File::Which::which($class->_driver()); | |||||||||||
| 24 | 0 | ▶ | die "Could not find driver!" unless $object->{driver_file}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | #XXX appears that escaping from system() does not work correctly on win32 thanks to the join() I have? to do later, sigh | ||||||||||||
| 26 | 0 | $object->{driver_file} = qq/"$object->{driver_file}"/; | |||||||||||
| 27 | |||||||||||||
| 28 | 0 | my @config = ($object->{port}); | |||||||||||
| 29 | |||||||||||||
| 30 | # Build command string | ||||||||||||
| 31 | $object->{command} //= [ | ||||||||||||
| 32 | $object->{driver_file}, | ||||||||||||
| 33 | 0 | ▶ | @config, | ||||||||||
|
Condition0%0/2
$object->{"command"} //= [$object->{"driver_file"}, @config]
MC/DC0%0/1
$object->{"command"} //= [$object->{"driver_file"}, @config]
$object->{"command"}
Truth table0%0/2
A
A= $object->{"command"}
| |||||||||||||
| 34 | ]; | ||||||||||||
| 35 | 0 | return $object; | |||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | 1 | 1; | |||||||||||
| 39 | |||||||||||||
| 40 | __END__ | ||||||||||||
| 41 | |||||||||||||
| 42 | =pod | ||||||||||||
| 43 | |||||||||||||
| 44 | =encoding UTF-8 | ||||||||||||
| 45 | |||||||||||||
| 46 | =head1 NAME | ||||||||||||
| 47 | |||||||||||||
| 48 | Selenium::Driver::WinApp - Tell Selenium::Client how to spawn the Windows Application Driver | ||||||||||||
| 49 | |||||||||||||
| 50 | =head1 VERSION | ||||||||||||
| 51 | |||||||||||||
| 52 | version 1.06 | ||||||||||||
| 53 | |||||||||||||
| 54 | =head1 Mode of Operation | ||||||||||||
| 55 | |||||||||||||
| 56 | Spawns a WinAppDriver server on the provided port (which the caller will assign randomly) | ||||||||||||
| 57 | Relies on WinAppDriver being in your $PATH (put in this to your user's PATH env var:) | ||||||||||||
| 58 | |||||||||||||
| 59 | %PROGRAMFILES(X86)%\Windows Application Driver | ||||||||||||
| 60 | |||||||||||||
| 61 | Pipes log output to ~/.selenium/perl-client/$port.log | ||||||||||||
| 62 | |||||||||||||
| 63 | =head1 SUBROUTINES | ||||||||||||
| 64 | |||||||||||||
| 65 | =head2 build_spawn_opts($class,$object) | ||||||||||||
| 66 | |||||||||||||
| 67 | Builds a command string which can run the driver binary. | ||||||||||||
| 68 | All driver classes must build this. | ||||||||||||
| 69 | |||||||||||||
| 70 | =head1 AUTHOR | ||||||||||||
| 71 | |||||||||||||
| 72 | George S. Baugh <george@troglodyne.net> | ||||||||||||
| 73 | |||||||||||||
| 74 | =head1 COPYRIGHT AND LICENSE | ||||||||||||
| 75 | |||||||||||||
| 76 | This software is Copyright (c) 2023 by George S. Baugh. | ||||||||||||
| 77 | |||||||||||||
| 78 | This is free software, licensed under: | ||||||||||||
| 79 | |||||||||||||
| 80 | The MIT (X11) License | ||||||||||||
| 81 | |||||||||||||
| 82 | =cut | ||||||||||||