ソースを参照

Merge branch 'master' of github.com:teodesian/Selenium-Remote-Driver

George S. Baugh 4 年 前
コミット
de757883c8
3 ファイル変更24 行追加6 行削除
  1. 7 0
      Changes
  2. 1 1
      dist.ini
  3. 16 5
      lib/Test/Selenium/Remote/Driver.pm

+ 7 - 0
Changes

@@ -1,5 +1,12 @@
 Revision history for Selenium-Remote-Driver
 Revision history for Selenium-Remote-Driver
 
 
+1.42  03-17-2021 TEODESIAN
+        - Once more with feeling
+
+1.41  03-16-2021 TEODESIAN
+        [BUG FIXES]
+        - Declare minimum versions in testsuite to suppress CPANTesters failures
+
 1.40  02-03-2021 TEODESIAN
 1.40  02-03-2021 TEODESIAN
         [BUG FIXES]
         [BUG FIXES]
         - suppress warning in CanStartBinary when geckodriver not in PWD
         - suppress warning in CanStartBinary when geckodriver not in PWD

+ 1 - 1
dist.ini

@@ -1,5 +1,5 @@
 name = Selenium-Remote-Driver
 name = Selenium-Remote-Driver
-version = 1.40
+version = 1.42
 author = George S. Baugh <george@troglodyne.net>
 author = George S. Baugh <george@troglodyne.net>
 author = Aditya Ivaturi <ivaturi@gmail.com>
 author = Aditya Ivaturi <ivaturi@gmail.com>
 author = Daniel Gempesaw <gempesaw@gmail.com>
 author = Daniel Gempesaw <gempesaw@gmail.com>

+ 16 - 5
lib/Test/Selenium/Remote/Driver.pm

@@ -106,17 +106,23 @@ distribution, and some interfaces may change.
 
 
 This will create a new Test::Selenium::Remote::Driver object, which subclasses
 This will create a new Test::Selenium::Remote::Driver object, which subclasses
 L<Selenium::Remote::Driver>.  This subclass provides useful testing
 L<Selenium::Remote::Driver>.  This subclass provides useful testing
-functions.  It is modeled on L<Test::WWW::Selenium>.
+functions. It is modeled on L<Test::WWW::Selenium>.
 
 
 Environment vars can be used to specify options to pass to
 Environment vars can be used to specify options to pass to
 L<Selenium::Remote::Driver>. ENV vars are prefixed with C<TWD_>.
 L<Selenium::Remote::Driver>. ENV vars are prefixed with C<TWD_>.
-( After the old fork name, "Test::WebDriver" )
+( After the old fork name, "Test::WebDriver" ). The explicity passed
+options have precedence. ENV vars take only effect when they are
+actually set. This important e.g. for the option C<javascript>, which
+is turned on per default in L<Selenium::Remote::Driver>.
 
 
 Set the Selenium server address with C<$TWD_HOST> and C<$TWD_PORT>.
 Set the Selenium server address with C<$TWD_HOST> and C<$TWD_PORT>.
 
 
 Pick which browser is used using the  C<$TWD_BROWSER>, C<$TWD_VERSION>,
 Pick which browser is used using the  C<$TWD_BROWSER>, C<$TWD_VERSION>,
 C<$TWD_PLATFORM>, C<$TWD_JAVASCRIPT>, C<$TWD_EXTRA_CAPABILITIES>.
 C<$TWD_PLATFORM>, C<$TWD_JAVASCRIPT>, C<$TWD_EXTRA_CAPABILITIES>.
 
 
+C<$TWD_BROWSER> is actually an alias for C<$TWD_BROWSER_NAME>.
+C<$TWD_HOST> is actually an alias for C<$TWD_REMOTE_SERVER_ADDR>.
+
 See L<Selenium::Remote::Driver> for the meanings of these options.
 See L<Selenium::Remote::Driver> for the meanings of these options.
 
 
 =for Pod::Coverage BUILDARGS
 =for Pod::Coverage BUILDARGS
@@ -126,15 +132,20 @@ See L<Selenium::Remote::Driver> for the meanings of these options.
 sub BUILDARGS {
 sub BUILDARGS {
     my ( undef, %p ) = @_;
     my ( undef, %p ) = @_;
 
 
+    OPT:
     for my $opt (
     for my $opt (
         qw/remote_server_addr port browser_name version platform
         qw/remote_server_addr port browser_name version platform
         javascript auto_close extra_capabilities/
         javascript auto_close extra_capabilities/
       )
       )
     {
     {
-        $p{$opt} //= $ENV{ 'TWD_' . uc($opt) };
+        my $env_var_name = 'TWD_' . uc($opt);
+
+        next OPT unless exists $ENV{$env_var_name};
+
+        $p{$opt} //= $ENV{$env_var_name};
     }
     }
-    $p{browser_name}       //= $ENV{TWD_BROWSER};                      # ykwim
-    $p{remote_server_addr} //= $ENV{TWD_HOST};                         # ykwim
+    $p{browser_name}       //= $ENV{TWD_BROWSER} if exists $ENV{TWD_BROWSER};  # ykwim
+    $p{remote_server_addr} //= $ENV{TWD_HOST}    if exists $ENV{TWD_HOST};     # ykwim
     $p{webelement_class}   //= 'Test::Selenium::Remote::WebElement';
     $p{webelement_class}   //= 'Test::Selenium::Remote::WebElement';
     return \%p;
     return \%p;
 }
 }