瀏覽代碼

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