Преглед изворни кода

Document binary and binary_port

Daniel Gempesaw пре 10 година
родитељ
комит
ed6fc1e569
3 измењених фајлова са 64 додато и 0 уклоњено
  1. 21 0
      lib/Selenium/Chrome.pm
  2. 21 0
      lib/Selenium/Firefox.pm
  3. 22 0
      lib/Selenium/PhantomJS.pm

+ 21 - 0
lib/Selenium/Chrome.pm

@@ -35,6 +35,13 @@ has '+browser_name' => (
     default => sub { 'chrome' }
 );
 
+=attr binary
+
+Optional: specify the path to your binary. If you don't specify
+anything, we'll try to find it on our own via L<File::Which/which>.
+
+=cut
+
 has 'binary' => (
     is => 'lazy',
     coerce => \&coerce_simple_binary,
@@ -42,6 +49,20 @@ has 'binary' => (
     predicate => 1
 );
 
+=attr binary_port
+
+Optional: specify the port that we should bind to. If you don't
+specify anything, we'll default to the driver's default port. Since
+there's no a priori guarantee that this will be an open port, this is
+_not_ necessarily the port that we end up using - if the port here is
+already bound, we'll search above it until we find an open one.
+
+See L<Selenium::CanStartBinary/port> for more details, and
+L<Selenium::Remote::Driver/port> after instantiation to see what the
+actual port turned out to be.
+
+=cut
+
 has 'binary_port' => (
     is => 'lazy',
     default => sub { 9515 }

+ 21 - 0
lib/Selenium/Firefox.pm

@@ -35,6 +35,13 @@ has '+browser_name' => (
     default => sub { 'firefox' }
 );
 
+=attr binary
+
+Optional: specify the path to your binary. If you don't specify
+anything, we'll try to find it on our own via L<File::Which/which>.
+
+=cut
+
 has 'binary' => (
     is => 'lazy',
     coerce => \&coerce_firefox_binary,
@@ -42,6 +49,20 @@ has 'binary' => (
     predicate => 1
 );
 
+=attr binary_port
+
+Optional: specify the port that we should bind to. If you don't
+specify anything, we'll default to the driver's default port. Since
+there's no a priori guarantee that this will be an open port, this is
+_not_ necessarily the port that we end up using - if the port here is
+already bound, we'll search above it until we find an open one.
+
+See L<Selenium::CanStartBinary/port> for more details, and
+L<Selenium::Remote::Driver/port> after instantiation to see what the
+actual port turned out to be.
+
+=cut
+
 has 'binary_port' => (
     is => 'lazy',
     default => sub { 9090 }

+ 22 - 0
lib/Selenium/PhantomJS.pm

@@ -36,6 +36,13 @@ has '+browser_name' => (
     default => sub { 'phantomjs' }
 );
 
+=attr binary
+
+Optional: specify the path to your binary. If you don't specify
+anything, we'll try to find it on our own via L<File::Which/which>.
+
+=cut
+
 has 'binary' => (
     is => 'lazy',
     coerce => \&coerce_simple_binary,
@@ -43,6 +50,20 @@ has 'binary' => (
     predicate => 1
 );
 
+=attr binary_port
+
+Optional: specify the port that we should bind to. If you don't
+specify anything, we'll default to the driver's default port. Since
+there's no a priori guarantee that this will be an open port, this is
+_not_ necessarily the port that we end up using - if the port here is
+already bound, we'll search above it until we find an open one.
+
+See L<Selenium::CanStartBinary/port> for more details, and
+L<Selenium::Remote::Driver/port> after instantiation to see what the
+actual port turned out to be.
+
+=cut
+
 has 'binary_port' => (
     is => 'lazy',
     default => sub { 8910 }
@@ -53,6 +74,7 @@ sub DEMOLISH {
 
     $self->shutdown_binary;
 }
+
 with 'Selenium::CanStartBinary';
 
 1;