Преглед на файлове

Add predicates to remote_server_addr and port

This will help us define the default behavior for Selenium::Firefox and
Selenium::Chrome. If the user specifies a server address and/or port,
they probably already have something in mind. If no address or port is
specified, we'll try finding the binaries ourselves and starting them,
taking care of setting the port ourselves.

If that doesn't work, we're considering falling back to the default
behavior of trying to start up a browser on localhost:4444/wd/hub.
Daniel Gempesaw преди 10 години
родител
ревизия
f65bc3edb5
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      lib/Selenium/Remote/Driver.pm

+ 2 - 0
lib/Selenium/Remote/Driver.pm

@@ -260,6 +260,7 @@ has 'remote_server_addr' => (
     is      => 'rw',
     coerce  => sub { ( defined($_[0]) ? $_[0] : 'localhost' )},
     default => sub {'localhost'},
+    predicate => 1
 );
 
 has 'browser_name' => (
@@ -289,6 +290,7 @@ has 'port' => (
     is      => 'rw',
     coerce  => sub { ( defined($_[0]) ? $_[0] : '4444' )},
     default => sub {'4444'},
+    predicate => 1
 );
 
 has 'version' => (