Branch Coverage

blib/lib/WWW/Mechanize/PhantomJS.pm
Criterion Covered Total %
branch 12 288 4.1


line true false branch
130 1 0 if ($options->{'port'})
136 0 1 if (my $cookie_file = delete $options->{'cookie_file'})
140 0 1 if (my $ignore_ssl_errors = delete $options->{'ignore_ssl_errors'})
146 0 1 $^O =~ /mswin/i && $options->{'launch_exe'} =~ /\s/ ? :
149 0 1 if ($^O =~ /mswin/i)
162 1 0 unless (defined $options{'port'})
172 0 1 if ($sock)
182 0 1 unless (exists $options{'autodie'})
184 1 0 unless (exists $options{'frames'})
187 1 0 unless ($options{'pid'})
190 1 0 if (@cmd > 1) { }
193 1 0 unless $options{'pid'} = open($options{'fh'}, $mode, @cmd)
198 0 0 unless $options{'pid'} = open($options{'fh'}, $cmd[0])
211 0 0 if ($socket)
216 0 0 if time - $t < 1
242 0 0 if ($@)
243 0 0 if $options{'kill_pid'}
319 0 0 if @_ == 2
327 0 0 if ('javascript' eq $opt) { }
408 0 0 unless defined $affirmative
409 0 0 $affirmative ? :
490 0 0 if (my $child_out = $_[0]{'fh'})
500 0 0 if ($pid)
563 0 0 if ref $phantom_res eq '' and $phantom_res eq '1'
573 0 0 unless ($phantom_res->{'status'})
620 0 0 'File::Spec'->file_name_is_absolute($htmlfile) ? :
628 0 0 if ($^O =~ /mswin/i) { }
635 0 0 if (0 + $res->headers->header_field_names and [$res->headers->header_field_names]->[0] ne 'x-www-mechanize-phantomjs-fake-success' || $self->uri ne 'about:blank') { }
694 0 0 unless ($options{'data'})
818 0 0 if ($self->{'autodie'}) { }
828 0 0 if ($self->{'autodie'}) { }
829 0 0 if ($self->status and not $self->status =~ /^2/ and $self->status != 0)
853 0 0 if $res
967 0 0 if ('html' eq $format) { }
0 0 elsif ($format eq 'text') { }
1006 0 0 if (my($meta) = $self->xpath(q[//meta[translate(@http-equiv,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')="content-type"]], 'first', 1))
1008 0 0 if $ct
1045 0 0 if $base
1064 0 0 if (my($meta) = $self->xpath(q[//meta[translate(@http-equiv,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')="content-type"]], 'first', 1))
1067 0 0 if (not $ct and my $r = $self->response)
1071 0 0 if defined $ct
1136 0 0 if ($tag)
1137 0 0 if (not exists $WWW::Mechanize::PhantomJS::link_spec{$tag}) { }
1145 0 0 if ($tag eq 'meta')
1147 0 0 if ($content =~ /^\d+\s*;\s*url\s*=\s*(\S+)/i) { }
1149 0 0 unless $url =~ s/^"(.+)"$/$1/
1156 0 0 if (defined $url) { }
1274 0 0 unless $WWW::Mechanize::PhantomJS::xpath_quote{$1}
1284 0 0 if (exists $opts{$_})
1291 0 0 if ($single and exists $opts{'n'})
1295 0 0 if $n ne 'all'
1314 0 0 if length $op
1317 0 0 if (exists $opts{$key})
1324 0 0 if (my $p = delete $opts{'url'})
1328 0 0 if (my $p = delete $opts{'tag'})
1331 0 0 if (my $p = delete $opts{'tag_regex'})
1336 0 0 exists $WWW::Mechanize::PhantomJS::link_spec{$_} ? :
1338 0 0 if (@full) { }
1348 0 0 if (keys %opts)
1359 0 0 if ($one)
1360 0 0 if (0 == @res)
1361 0 0 if ($single)
1362 0 0 if (1 < @res)
1371 0 0 if ($n eq 'all')
1395 0 0 if 'all' eq ($opts{'n'} || '')
1396 0 0 if (my $link = $self->find_link_dom('frames', 0, %opts)) { }
1425 0 0 if wantarray
1448 0 0 if wantarray
1468 0 0 if (@_ == 2) { }
1492 0 0 unless ($doc->{'__path'})
1509 0 0 unless ($just_parent)
1516 0 0 if ('html' ne $tag and '' ne $tag)
1526 0 0 if ($body)
1635 0 0 if ('ARRAY' ne (ref $query || ''))
1639 0 0 unless (exists $options{'frames'})
1656 0 0 unless (exists $options{'all'} or $return_first_element)
1657 0 0 if defined wantarray and not wantarray
1668 0 0 if ($options{'document'})
1694 0 0 if ($options{'node'}) { }
1709 0 0 unless (@found)
1734 0 0 if ($options{'frames'} and not $options{'node'})
1754 0 0 if (not $zero_allowed and @res == 0)
1757 0 0 if (not $two_allowed and @res > 1)
1763 0 0 $return_first_element ? :
1786 0 0 if ('ARRAY' ne (ref $query || ''))
1852 0 0 if (not defined $name) { }
0 0 elsif (ref $name and &blessed($name) and $name->can('click')) { }
0 0 elsif (ref $name eq 'HASH') { }
1862 0 0 if (exists $options{'name'})
1867 0 0 if ($options{'name'} eq '')
1875 0 0 if ($options{'dom'}) { }
1884 0 0 if (defined wantarray)
1902 0 0 if (exists $options{$meth})
1908 0 0 unless $method
1916 0 0 unless (grep {exists $options->{$_};} 'single', 'one', 'maybe', 'all', 'any')
1965 0 0 if (exists $options{'input'}) { }
0 0 elsif (exists $options{'name'}) { }
0 0 elsif (exists $options{'value'}) { }
0 0 elsif (exists $options{'id'}) { }
0 0 elsif (exists $options{'number'}) { }
1989 0 0 if ($node) { }
2019 0 0 unless $self->{'current_form'}
2032 0 0 unless ($focus)
2064 0 0 if ($type = $f->get_attribute('type') || '')
2155 0 0 if (ref $fields[0] eq 'HASH')
2192 0 0 wantarray ? :
2253 0 0 if (@_ == 3) { }
2285 0 0 if ($name =~ s/^\^//) { }
0 0 elsif ($name =~ s/^#//) { }
0 0 elsif ($name =~ s/^\.//) { }
2292 0 0 if (&blessed($name)) { }
2323 0 0 unless ref $pre
2325 0 0 unless ref $post
2328 0 0 if ($fields[0]) { }
2330 0 0 if ($set_value)
2337 0 0 $value ? :
2356 0 0 unless defined wantarray
2360 0 0 if ('SELECT' eq uc $tag) { }
2363 0 0 if (wantarray) { }
2392 0 0 if ($dom_form) { }
2456 0 0 unless ($form)
2457 0 0 if ($fields = delete $options{'with_fields'}) { }
2460 0 0 unless ($form)
2470 0 0 unless ($form)
2477 0 0 if ($options{'button'}) { }
2505 0 0 unless ($f)
2517 0 0 if (ref $v)
2519 0 0 unless $num == 1
2542 0 0 ref $spec ? :
2545 0 0 if (not ref $spec || $spec =~ /\D/ and $spec == 1)
2552 0 0 if (not grep({ref $_;} @spec)) { }
2561 0 0 ref $_ ? :
2646 0 0 if &blessed($e) and $e->isa('Selenium::Remote::WebElement')
2650 0 0 unless $res->{'id'}
2689 0 0 if (scalar keys %$rect)
2760 0 0 unless my $element = delete $options{'element'}
2829 0 0 unless ($outname)
2846 0 0 if ($wantresult)
2847 0 0 unless open my $fh, '<', $outname
2855 0 0 unless unlink $_
2939 0 0 if ($self->{'report_js_errors'})
2940 0 0 if (my(@errors) = $self->js_errors)
2953 0 0 @{$_->{'trace'};} ? :
0 0 @{$_->{'trace'};} && $_->{'trace'}[-1]{'function'} ? :