Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Updated Selenium::Remote::Driver to latest v1.39.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgruner committed Jan 11, 2021
1 parent 0224407 commit 9eaad28
Show file tree
Hide file tree
Showing 24 changed files with 124 additions and 59 deletions.
20 changes: 12 additions & 8 deletions Kernel/cpan-lib/Selenium/ActionChains.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::ActionChains;
$Selenium::ActionChains::VERSION = '1.38';
$Selenium::ActionChains::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -129,9 +129,11 @@ sub key_down {
if ( defined($element) ) {
$self->click($element);
}
push @{ $self->actions },
sub { $self->driver->send_keys_to_active_element(@$value) };
$self;
foreach my $v (@$value) {
push @{ $self->actions },
sub { $self->driver->general_action( actions => [ { type => 'key', id => 'key', actions => [ { type => 'keyDown', value => $v } ] } ] ) };
}
return $self;
}

sub key_up {
Expand All @@ -140,9 +142,11 @@ sub key_up {
if ( defined($element) ) {
$self->click($element);
}
push @{ $self->actions },
sub { $self->driver->send_keys_to_active_element(@$value) };
$self;
foreach my $v (@$value) {
push @{ $self->actions },
sub { $self->driver->$self->driver->general_action( actions => [ { type => 'key', id => 'key', actions => [ { type => 'keyUp', value => $v } ] } ] ) };
}
return $self;
}

sub send_keys {
Expand Down Expand Up @@ -174,7 +178,7 @@ Selenium::ActionChains - Action chains for Selenium::Remote::Driver
=head1 VERSION
version 1.38
version 1.39
=head1 SYNOPSIS
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/CanStartBinary.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::CanStartBinary;
$Selenium::CanStartBinary::VERSION = '1.38';
$Selenium::CanStartBinary::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -381,7 +381,7 @@ Selenium::CanStartBinary - Teach a WebDriver how to start its own binary aka no
=head1 VERSION
version 1.38
version 1.39
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/CanStartBinary/FindBinary.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::CanStartBinary::FindBinary;
$Selenium::CanStartBinary::FindBinary::VERSION = '1.38';
$Selenium::CanStartBinary::FindBinary::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -86,7 +86,7 @@ Selenium::CanStartBinary::FindBinary - Coercions for finding webdriver binaries
=head1 VERSION
version 1.38
version 1.39
=for Pod::Coverage *EVERYTHING*
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/CanStartBinary/ProbePort.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::CanStartBinary::ProbePort;
$Selenium::CanStartBinary::ProbePort::VERSION = '1.38';
$Selenium::CanStartBinary::ProbePort::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -49,7 +49,7 @@ Selenium::CanStartBinary::ProbePort - Utility functions for finding open ports t
=head1 VERSION
version 1.38
version 1.39
=for Pod::Coverage *EVERYTHING*
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/Chrome.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Chrome;
$Selenium::Chrome::VERSION = '1.38';
$Selenium::Chrome::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -57,7 +57,7 @@ Selenium::Chrome - Use ChromeDriver without a Selenium server
=head1 VERSION
version 1.38
version 1.39
=head1 SYNOPSIS
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/Edge.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Edge;
$Selenium::Edge::VERSION = '1.38';
$Selenium::Edge::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -57,7 +57,7 @@ Selenium::Edge - Use EdgeDriver without a Selenium server
=head1 VERSION
version 1.38
version 1.39
=head1 SYNOPSIS
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/Firefox.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Firefox;
$Selenium::Firefox::VERSION = '1.38';
$Selenium::Firefox::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -139,7 +139,7 @@ Selenium::Firefox - Use FirefoxDriver without a Selenium server
=head1 VERSION
version 1.38
version 1.39
=head1 SYNOPSIS
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/Firefox/Binary.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Firefox::Binary;
$Selenium::Firefox::Binary::VERSION = '1.38';
$Selenium::Firefox::Binary::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -126,7 +126,7 @@ Selenium::Firefox::Binary - Subroutines for locating and properly initializing t
=head1 VERSION
version 1.38
version 1.39
=head1 SUBROUTINES
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/Firefox/Profile.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Firefox::Profile;
$Selenium::Firefox::Profile::VERSION = '1.38';
$Selenium::Firefox::Profile::VERSION = '1.39';
# ABSTRACT: Use custom profiles with Selenium::Remote::Driver
# TODO: convert this to Moo!

Expand Down Expand Up @@ -274,7 +274,7 @@ Selenium::Firefox::Profile - Use custom profiles with Selenium::Remote::Driver
=head1 VERSION
version 1.38
version 1.39
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/InternetExplorer.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::InternetExplorer;
$Selenium::InternetExplorer::VERSION = '1.38';
$Selenium::InternetExplorer::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -33,7 +33,7 @@ Selenium::InternetExplorer - A convenience package for creating a IE instance
=head1 VERSION
version 1.38
version 1.39
=head1 SYNOPSIS
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/PhantomJS.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::PhantomJS;
$Selenium::PhantomJS::VERSION = '1.38';
$Selenium::PhantomJS::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -54,7 +54,7 @@ Selenium::PhantomJS - Use GhostDriver without a Selenium server
=head1 VERSION
version 1.38
version 1.39
=head1 SYNOPSIS
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/Remote/Commands.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Remote::Commands;
$Selenium::Remote::Commands::VERSION = '1.38';
$Selenium::Remote::Commands::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -521,7 +521,7 @@ Selenium::Remote::Commands - Implement commands for Selenium::Remote::Driver for
=head1 VERSION
version 1.38
version 1.39
=head1 DESCRIPTION
Expand Down
42 changes: 36 additions & 6 deletions Kernel/cpan-lib/Selenium/Remote/Driver.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Remote::Driver;
$Selenium::Remote::Driver::VERSION = '1.38';
$Selenium::Remote::Driver::VERSION = '1.39';
use strict;
use warnings;

Expand Down Expand Up @@ -230,6 +230,11 @@ has 'firefox_profile' => (
clearer => 1
);

has debug => (
is => 'lazy',
default => sub { 0 },
);

has 'desired_capabilities' => (
is => 'lazy',
predicate => 'has_desired_capabilities'
Expand Down Expand Up @@ -290,6 +295,9 @@ sub BUILD {
$self->set_inner_window_size(@$size);
}

#Set debug if needed
$self->debug_on() if $self->debug;

# Setup non-croaking, parameter versions of finders
foreach my $by ( keys %{ $self->FINDERS } ) {
my $finder_name = 'find_element_by_' . $by;
Expand Down Expand Up @@ -419,7 +427,7 @@ sub new_session {
'browserName' => $self->browser_name,
'platform' => $self->platform,
'javascriptEnabled' => $self->javascript,
'version' => $self->version,
'version' => $self->version // '',
'acceptSslCerts' => $self->accept_ssl_certs,
%$extra_capabilities,
},
Expand Down Expand Up @@ -1142,6 +1150,7 @@ sub switch_to_frame {
$id = ( defined $id ) ? $id : $json_null;

my $res = { 'command' => 'switchToFrame' };

if ( ref $id eq $self->webelement_class ) {
if ( $self->{is_wd3} ) {
$params =
Expand Down Expand Up @@ -1656,7 +1665,8 @@ sub _get_button {
return $button_enum->{ uc $1 };
}
if ( defined $button && $button =~ /(0|1|2)/ ) {
return $1;
#Handle user error sending in "1"
return int($1);
}
return 0;
}
Expand All @@ -1672,7 +1682,7 @@ sub double_click {
{
$self->click( $button, 1 );
$self->click( $button, 1 );
$self->general_action();
return $self->general_action();
}

my $res = { 'command' => 'doubleClick' };
Expand Down Expand Up @@ -1880,7 +1890,7 @@ Selenium::Remote::Driver - Perl Client for Selenium Remote Driver
=head1 VERSION
version 1.38
version 1.39
=head1 SYNOPSIS
Expand Down Expand Up @@ -2141,6 +2151,8 @@ Desired capabilities - HASH - Following options are accepted:
=item B<extra_capabilities> - HASH - Any other extra capabilities. Accepted keys will vary by browser. If firefox_profile is passed, the args (or profile) key will be overwritten, depending on how it was passed.
=item B<debug> - BOOL - Turn Debug mode on from the start if true, rather than having to call debug_on().
=back
On WebDriver3 the 'extra_capabilities' will be automatically converted into the parameter needed by your browser.
Expand Down Expand Up @@ -2556,6 +2568,16 @@ Called with no arguments, it simply executes the existing action queue.
If you are looking for pre-baked action chains that aren't currently part of L<Selenium::Remote::Driver>,
consider L<Selenium::ActionChains>, which is shipped with this distribution instead.
=head3 COMPATIBILITY
Like most places, the WC3 standard is openly ignored by the driver binaries.
Generally an "actions" object will only accept:
{ type => ..., value => ... }
When using the direct drivers (E.G. Selenium::Chrome, Selenium::Firefox).
This is not documented anywhere but here, as far as I can tell.
=head2 release_general_action
Nukes *all* input device state (modifier key up/down, pointer button up/down, pointer location, and other device state) from orbit.
Expand Down Expand Up @@ -2980,6 +3002,10 @@ To conveniently write the screenshot to a file, see L</capture_screenshot>.
or
$driver->switch_to_frame($driver->find_element('iframe', 'tag_name'));
=head3 COMPATIBILITY
Chromedriver will vomit if you pass anything but a webElement, so you probably should do that from now on.
=head2 switch_to_parent_frame
Webdriver 3 equivalent of calling switch_to_frame with no arguments (e.g. NULL frame).
Expand Down Expand Up @@ -3731,7 +3757,7 @@ Aditya Ivaturi <[email protected]>
=head1 CONTRIBUTORS
=for stopwords Allen Lew A.MacLeay Andy Jack Bas Bloemsaat Blake GH Brian Horakh Charles Howes Chris Davies Daniel Fackrell Dave Rolsky Dmitry Karasik Doug Bell Dylan Streb Eric Johnson Gabor Szabo George S. Baugh Gerhard Jungwirth Gordon Child GreatFlamingFoo Ivan Kurmanov Joe Higton Jon Hermansen Keita Sugama Ken Swanson lembark Luke Closs Martin Gruner Matthew Spahr Max O'Cull Michael Prokop mk654321 Peter Mottram (SysPete) Phil Kania Mitchell Prateek Goyal Richard Sailer Robert Utter rouzier Tetsuya Tatsumi Tod Hagan Tom Hukins Vangelis Katsikaros Vishwanath Janmanchi Viťas Strádal Yves Lavoie
=for stopwords Allen Lew A.MacLeay Andy Jack Bas Bloemsaat Blake GH Brian Horakh Charles Howes Chris Davies Daniel Fackrell Dave Rolsky Dmitry Karasik Doug Bell Dylan Streb Eric Johnson Gabor Szabo George S. Baugh Gerhard Jungwirth Gordon Child GreatFlamingFoo Ivan Kurmanov Joe Higton Jon Hermansen Keita Sugama Ken Swanson lembark Luke Closs Martin Gruner Matthew Spahr Max O'Cull Michael Prokop mk654321 Peter Mottram (SysPete) Phil Kania Mitchell Prateek Goyal Richard Sailer Robert Utter rouzier Tetsuya Tatsumi Tod Hagan Tom Hukins Vangelis Katsikaros Vishwanath Janmanchi Viťas Strádal Yuki Kimoto Yves Lavoie
=over 4
Expand Down Expand Up @@ -3921,6 +3947,10 @@ Viťas Strádal <[email protected]>
=item *
Yuki Kimoto <[email protected]>
=item *
Yves Lavoie <[email protected]>
=back
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Remote::Driver::CanSetWebdriverContext;
$Selenium::Remote::Driver::CanSetWebdriverContext::VERSION = '1.38';
$Selenium::Remote::Driver::CanSetWebdriverContext::VERSION = '1.39';
# ABSTRACT: Customize the webdriver context prefix for various drivers

use strict;
Expand Down Expand Up @@ -27,7 +27,7 @@ Selenium::Remote::Driver::CanSetWebdriverContext - Customize the webdriver conte
=head1 VERSION
version 1.38
version 1.39
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions Kernel/cpan-lib/Selenium/Remote/Driver/Firefox/Profile.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package Selenium::Remote::Driver::Firefox::Profile;
$Selenium::Remote::Driver::Firefox::Profile::VERSION = '1.38';
$Selenium::Remote::Driver::Firefox::Profile::VERSION = '1.39';
# ABSTRACT: Use custom profiles with Selenium::Remote::Driver
use strict;
use warnings;
Expand All @@ -25,7 +25,7 @@ Selenium::Remote::Driver::Firefox::Profile - Use custom profiles with Selenium::
=head1 VERSION
version 1.38
version 1.39
=head1 DESCRIPTION
Expand Down
Loading

0 comments on commit 9eaad28

Please sign in to comment.