소스 검색

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' => (