|
|
@@ -121,6 +121,32 @@ has '+port' => (
|
|
|
}
|
|
|
);
|
|
|
|
|
|
+=attr startup_timeout
|
|
|
+
|
|
|
+Optional: you can modify how long we will wait for the binary to start
|
|
|
+up. By default, we will start the binary and check the intended
|
|
|
+destination port for 10 seconds before giving up. If the machine
|
|
|
+you're using to run your browsers is slower or smaller, you may need
|
|
|
+to increase this timeout.
|
|
|
+
|
|
|
+The following:
|
|
|
+
|
|
|
+ my $f = Selenium::Firefox->new(
|
|
|
+ startup_timeout => 60
|
|
|
+ );
|
|
|
+
|
|
|
+will wait up to 60 seconds for the firefox binary to respond on the
|
|
|
+proper port. To use this constructor option, you should specify a time
|
|
|
+in seconds as an integer, and it will be passed to the arguments
|
|
|
+section of a L<Selenium::Waiter/wait_until> subroutine call.
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+has startup_timeout => (
|
|
|
+ is => 'lazy',
|
|
|
+ default => sub { 10 }
|
|
|
+);
|
|
|
+
|
|
|
=attr binary_mode
|
|
|
|
|
|
Mostly intended for internal use, its builder coordinates all the side
|
|
|
@@ -228,7 +254,7 @@ sub _build_binary_mode {
|
|
|
my $command = $self->_construct_command;
|
|
|
system($command);
|
|
|
|
|
|
- my $success = wait_until { probe_port($port) } timeout => 10;
|
|
|
+ my $success = wait_until { probe_port($port) } timeout => $self->startup_timeout;
|
|
|
if ($success) {
|
|
|
return 1;
|
|
|
}
|