Selenium/Remote/Mock/Commands.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 95.5% 43 / 45 SCAR 13.9
CC
4
Cov
100%
get_method_name_from_parameters
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« Test/Selenium/Remote/WebElement.pm ↑ Summary Selenium/CanStartBinary/ProbePort.pm »
1 package Selenium::Remote::Mock::Commands;
2 4 $Selenium::Remote::Mock::Commands::VERSION = '1.49';
3 # ABSTRACT: utility class to mock Selenium::Remote::Commands
4  
5 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 extends 'Selenium::Remote::Commands';
10  
11  
12 # override get_params so we do not rewrite the parameters
13  
14 sub get_params {
15 90 ▶ my $self = shift;
Subroutine get_params: called CC=1 SCAR=0.0
Pod undocumented
16 90 my $args = shift;
17 90 my $data = {};
18 90 my $command = delete $args->{command};
19 90 $data->{'url'} = $self->get_url($command);
20 90 $data->{'method'} = $self->get_method($command);
21 90 $data->{'no_content_success'} = $self->get_no_content_success($command);
22 90 $data->{'url_params'} = $args;
23 90 return $data;
24 }
25  
26 sub get_method_name_from_parameters {
27 98 ▶ my $self = shift;
Subroutine get_method_name_from_parameters: called CC=4 SCAR=13.9
Pod undocumented
28 98 my $params = shift;
29 98 my $method_name = '';
30 98 my $cmds = $self->get_cmds();
31 98 foreach my $cmd ( keys %{$cmds} ) {
32 3931 ▶ if ( ( $cmds->{$cmd}->{method} eq $params->{method} )
Branch: 1 branch
BranchTrueFalseTotal
if ($cmds->{$cmd}{"method"} eq $params->{"method"} and $cmds->{$cmd}{"url"} eq $params->{"url"}) 98 3833 3931
Condition100%3/3
$cmds->{$cmd}{"method"} eq $params->{"method"} and $cmds->{$cmd}{"url"} eq $params->{"url"}
!ll&&!rl&&r
2053178098
MC/DC100%2/2
$cmds->{$cmd}{"method"} eq $params->{"method"} and $cmds->{$cmd}{"url"} eq $params->{"url"}
$cmds->{$cmd}{"method"} eq $params->{"method"} $cmds->{$cmd}{"url"} eq $params->{"url"}
Truth table100%3/3
A and B
A= $cmds->{$cmd}{"method"} eq $params->{"method"}B= $cmds->{$cmd}{"url"} eq $params->{"url"}
ABresult
0X0
100
111
33 && ( $cmds->{$cmd}->{url} eq $params->{url} ) )
34 {
35 98 $method_name = $cmd;
36 98 last;
37 }
38 }
39 98 return $method_name;
40 }
41  
42 4 1;
43  
44 __END__
45  
46 =pod
47  
48 =encoding UTF-8
49  
50 =head1 NAME
51  
52 Selenium::Remote::Mock::Commands - utility class to mock Selenium::Remote::Commands
53  
54 =head1 VERSION
55  
56 version 1.49
57  
58 =head1 DESCRIPTION
59  
60 Utility class to be for testing purposes, with L<Selenium::Remote::Mock::RemoteConnection> only.
61  
62 =for Pod::Coverage *EVERYTHING*
63  
64 =head1 AUTHORS
65  
66 Current Maintainers:
67  
68 =over 4
69  
70 =item *
71  
72 George S. Baugh <george@troglodyne.net>
73  
74 =back
75  
76 Previous maintainers:
77  
78 =over 4
79  
80 =item *
81  
82 Daniel Gempesaw <gempesaw@gmail.com>
83  
84 =item *
85  
86 Emmanuel Peroumalnaïk <peroumalnaik.emmanuel@gmail.com>
87  
88 =item *
89  
90 Luke Closs <cpan@5thplane.com>
91  
92 =item *
93  
94 Mark Stosberg <mark@stosberg.com>
95  
96 =back
97  
98 Original authors:
99  
100 =over 4
101  
102 =item *
103  
104 Aditya Ivaturi <ivaturi@gmail.com>
105  
106 =back
107  
108 =head1 COPYRIGHT AND LICENSE
109  
110 Copyright (c) 2010-2011 Aditya Ivaturi, Gordon Child
111  
112 Copyright (c) 2014-2017 Daniel Gempesaw
113  
114 Copyright (c) 2018-2021 George S. Baugh
115  
116 Licensed under the Apache License, Version 2.0 (the "License");
117 you may not use this file except in compliance with the License.
118 You may obtain a copy of the License at
119  
120 http://www.apache.org/licenses/LICENSE-2.0
121  
122 Unless required by applicable law or agreed to in writing, software
123 distributed under the License is distributed on an "AS IS" BASIS,
124 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125 See the License for the specific language governing permissions and
126 limitations under the License.
127  
128 =cut
« Test/Selenium/Remote/WebElement.pm ↑ Summary Selenium/CanStartBinary/ProbePort.pm »