Condition Coverage

blib/lib/WWW/Mechanize/PhantomJS.pm
Criterion Covered Total %
condition 8 255 3.1


and 3 conditions

line !l l&&!r l&&r condition
155 1 0 0 $^O =~ /mswin/i && $options->{'launch_exe'} =~ /\s/
171 1 0 0 defined $options{'port'} and not $options{'pid'}
573 0 0 0 ref $phantom_res eq "" and $phantom_res eq 1
645 0 0 0 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'
839 0 0 0 $self->status and not $self->status =~ /^2/
0 0 0 $self->status and not $self->status =~ /^2/ and $self->status != 0
1077 0 0 0 not $ct and my $r = $self->response
1101 0 0 0 defined $self->ct && $self->ct eq 'text/html'
1303 0 0 0 defined $p->{'url'} and not $link->url eq $p->{'url'}
1304 0 0 0 defined $p->{'url_regex'} and not $link->url =~ /$p->{'url_regex'}/
1305 0 0 0 defined $p->{'url_abs'} and not $link->url_abs eq $p->{'url_abs'}
1306 0 0 0 defined $p->{'url_abs_regex'} and not $link->url_abs =~ /$p->{'url_abs_regex'}/
1307 0 0 0 defined $link->text && $link->text eq $p->{'text'}
0 0 0 defined $p->{'text'} and not defined $link->text && $link->text eq $p->{'text'}
1308 0 0 0 defined $link->text && $link->text =~ /$p->{'text_regex'}/
0 0 0 defined $p->{'text_regex'} and not defined $link->text && $link->text =~ /$p->{'text_regex'}/
1309 0 0 0 defined $link->name && $link->name eq $p->{'name'}
0 0 0 defined $p->{'name'} and not defined $link->name && $link->name eq $p->{'name'}
1310 0 0 0 defined $link->name && $link->name =~ /$p->{'name_regex'}/
0 0 0 defined $p->{'name_regex'} and not defined $link->name && $link->name =~ /$p->{'name_regex'}/
1311 0 0 0 $link->tag && $link->tag eq $p->{'tag'}
0 0 0 defined $p->{'tag'} and not $link->tag && $link->tag eq $p->{'tag'}
1312 0 0 0 $link->tag && $link->tag =~ /$p->{'tag_regex'}/
0 0 0 defined $p->{'tag_regex'} and not $link->tag && $link->tag =~ /$p->{'tag_regex'}/
1314 0 0 0 $link->attrs->{'id'} && $link->attrs->{'id'} eq $p->{'id'}
0 0 0 defined $p->{'id'} and not $link->attrs->{'id'} && $link->attrs->{'id'} eq $p->{'id'}
1315 0 0 0 $link->attrs->{'id'} && $link->attrs->{'id'} =~ /$p->{'id_regex'}/
0 0 0 defined $p->{'id_regex'} and not $link->attrs->{'id'} && $link->attrs->{'id'} =~ /$p->{'id_regex'}/
1316 0 0 0 $link->attrs->{'class'} && $link->attrs->{'class'} eq $p->{'class'}
0 0 0 defined $p->{'class'} and not $link->attrs->{'class'} && $link->attrs->{'class'} eq $p->{'class'}
1317 0 0 0 $link->attrs->{'class'} && $link->attrs->{'class'} =~ /$p->{'class_regex'}/
0 0 0 defined $p->{'class_regex'} and not $link->attrs->{'class'} && $link->attrs->{'class'} =~ /$p->{'class_regex'}/
1336 0 0 0 $single and exists $opts{'n'}
1561 0 0 0 "html" ne $tag and "" ne $tag
1702 0 0 0 defined wantarray and not wantarray
1779 0 0 0 $options{'frames'} and not $options{'node'}
1799 0 0 0 not $zero_allowed and @res == 0
1802 0 0 0 not $two_allowed and @res > 1
1897 0 0 0 ref $name and builtin::blessed($name)
0 0 0 ref $name and builtin::blessed($name) and $name->can("click")
2590 0 0 0 not ref $spec || $spec =~ /\D/ and $spec == 1
2691 0 0 0 builtin::blessed($e) and $e->isa("Selenium::Remote::WebElement")
2998 0 0 0 @{$_->{'trace'};} && $_->{'trace'}[-1]{'function'}

or 2 conditions

line l !l condition
128 0 1 $options->{'log'} ||= "OFF"
130 0 1 $ENV{'PHANTOMJS_EXE'} || 'phantomjs'
134 0 1 $options->{'launch_arg'} ||= []
135 0 1 $options->{'phantomjs_arg'} ||= []
213 0 0 $options{'wait'} || 20
476 0 0 $cmds->{'phantomExecute'} ||= {"method", "POST", "url", "session/:sessionId/phantom/execute"}
973 0 0 $options{'format'} ||= "html"
974 0 0 delete $options{'format'} || 'html'
1339 0 0 delete $opts{'n'} || 1
1440 0 0 $opts{'n'} || ''
1680 0 0 ref $query || ''
1722 0 0 $doc->{'__path'} ||= []
1804 0 0 $_->get_text || ''
1831 0 0 ref $query || ''
1908 0 0 $options{'name'} || ''
2100 0 0 shift() || \*STDOUT
2103 0 0 $form->get_attribute('name') || ''
2109 0 0 $f->get_attribute('type') || ''
2113 0 0 $f->get_attribute('name') || ''
2510 0 0 delete $options{'fields'} || {}
2523 0 0 $options{'x'} || 0
0 0 $options{'y'} || 0
2676 0 0 $self->{'driver'}{'commands'}{'switchToParentFrame'} ||= {"method", "POST", "url", "session/:sessionId/frame/parent"}
2732 0 0 $rect ||= {}

or 3 conditions

line l !l&&r !l&&!r condition
130 0 1 0 $options->{'launch_exe'} ||= $ENV{'PHANTOMJS_EXE'} || 'phantomjs'
133 0 1 0 $options->{'launch_ghostdir'} ||= $ghostdir_default
245 0 0 0 $options{'driver'} ||= "Selenium::Remote::Driver"->new("port", $options{'port'}, "remote_server_addr", $localhost, "auto_close", 0, "error_handler", sub { local(@CARP_NOT) = (@CARP_NOT, ref $_[0], "Try::Tiny"); croak($_[1]); } )
293 0 0 0 $self->{'phantomjs_version'} ||= do { my $version = `$self->{'launch_exe'} --version`; $version =~ s/\s+//g; $version }
310 0 0 0 $self->{'ghostdriver_version'} ||= do { $self->eval_in_phantomjs("return ghostdriver.version") }
645 0 0 0 [$res->headers->header_field_names]->[0] ne 'x-www-mechanize-phantomjs-fake-success' || $self->uri ne 'about:blank'
841 0 0 0 $self->response('headers', 0)->message || sprintf('Got status code %d', $self->status)
1056 0 0 0 $base ||= $self->uri
1335 0 0 0 delete $opts{'one'} || $single
1356 0 0 0 $lefthand{$lvalue} || '@' . $lvalue
1692 0 0 0 $single || $first || $maybe || $any
1693 0 0 0 $options{'user_info'} ||= join("|", @$query)
1696 0 0 0 $single || $first
1697 0 0 0 $single || $maybe
1701 0 0 0 exists $options{'all'} or $return_first_element
1719 0 0 0 $options{'document'} || $self->document
1835 0 0 0 $options{'user_info'} ||= 'id ' . join(" or ", map({"'${_}'";} @$query)) . ' found'
1949 0 0 0 $rename{$meth} || $meth
2029 0 0 0 $node ||= $self->xpath($xpath, "node", $self->current_form, "single", 1, "user_message", $user_message)
2361 0 0 0 delete $options{'pre'} || $self->{'pre_value'}
2362 0 0 0 delete $options{'post'} || $self->{'post_value'}
2436 0 0 0 $dom_form ||= $self->current_form
2586 0 0 0 $spec ||= $self->{'frames'}
2588 0 0 0 $document ||= $self->document
2590 0 0 0 ref $spec || $spec =~ /\D/
2693 0 0 0 $e->{'WINDOW'} || $e->{'ELEMENT'}