| 1 | package Selenium::Chrome; | ||
| 2 | 1 | $Selenium::Chrome::VERSION = '1.50'; | |
| 3 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | # ABSTRACT: Use ChromeDriver without a Selenium server | ||
| 7 | 3 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 3 | ▶ | use Selenium::CanStartBinary::FindBinary qw/coerce_simple_binary/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | extends 'Selenium::Remote::Driver'; | |
| 10 | |||
| 11 | |||
| 12 | has '+browser_name' => ( | ||
| 13 | is => 'ro', | ||
| 14 | 0 | ▶ | default => sub { 'chrome' } |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 15 | 1 | ); | |
| 16 | |||
| 17 | |||
| 18 | has 'binary' => ( | ||
| 19 | is => 'lazy', | ||
| 20 | coerce => \&coerce_simple_binary, | ||
| 21 | 0 | ▶ | default => sub { 'chromedriver' }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 22 | 1 | predicate => 1 | |
| 23 | ); | ||
| 24 | |||
| 25 | |||
| 26 | has 'binary_port' => ( | ||
| 27 | is => 'lazy', | ||
| 28 | 0 | ▶ | default => sub { 9515 } |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 29 | 1 | ); | |
| 30 | |||
| 31 | has '_binary_args' => ( | ||
| 32 | is => 'lazy', | ||
| 33 | 0 | ▶ | builder => sub { |
|
Subroutine
_build__binary_args: not called CC=1 SCAR=6.9
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 34 | 0 | my ($self) = @_; | |
| 35 | |||
| 36 | 0 | my $context = $self->wd_context_prefix; | |
| 37 | 0 | $context =~ s{^/}{}; | |
| 38 | |||
| 39 | 0 | return ' --port=' . $self->port . ' --url-base=' . $context . ' '; | |
| 40 | } | ||
| 41 | 1 | ); | |
| 42 | |||
| 43 | 1 | with 'Selenium::CanStartBinary'; | |
| 44 | |||
| 45 | |||
| 46 | 1 | 1; | |
| 47 | |||
| 48 | __END__ | ||