Просмотр исходного кода

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 лет назад
Родитель
Сommit
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' => (