From 61839ea7118ea63017b194dc23721d67e368b0ab Mon Sep 17 00:00:00 2001 From: Yves Lavoie Date: Wed, 21 Mar 2018 00:14:53 -0400 Subject: [PATCH 1/2] Add get_property for W3C / Selenium3 compatibility --- CHANGES | 3 +++ lib/Weasel/Driver/Selenium2.pm | 23 +++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index f16db7e..3878b33 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +** 0.08 / 2018-03-21 + - Add get_property for W3C / Selenium3 compatibility + ** 0.06 / 2016-10-03 - Make 'get_page_source' write info a file diff --git a/lib/Weasel/Driver/Selenium2.pm b/lib/Weasel/Driver/Selenium2.pm index 430c097..eddba96 100644 --- a/lib/Weasel/Driver/Selenium2.pm +++ b/lib/Weasel/Driver/Selenium2.pm @@ -5,7 +5,7 @@ Weasel::Driver::Selenium2 - Weasel driver wrapping Selenium::Remote::Driver =head1 VERSION -0.06 +0.08 =head1 SYNOPSIS @@ -52,7 +52,7 @@ use Weasel::DriverRole; use Moose; with 'Weasel::DriverRole'; -our $VERSION = '0.06'; +our $VERSION = '0.08'; =head1 ATTRIBUTES @@ -123,13 +123,14 @@ see L. =cut sub implements { - return '0.02'; + return '0.03'; } =item start A few capabilities can be specified in t/.pherkin.yaml Some can even be specified as environment variables, they will be expanded here if present. +Revised for Selenium3. See https://github.com/teodesian/Selenium-Remote-Driver#no-standalone-server =cut @@ -268,7 +269,21 @@ sub execute_script { sub get_attribute { my ($self, $id, $att) = @_; - return $self->_resolve_id($id)->get_attribute($att); + return $self->_resolve_id($id)->get_attribute($att, 1); +} + +=item get_property($id, $prop_name) + +With Selenium 2, the method WebElement.GetAttribute(...) returned the HTMLElement +property when present and the attribute otherwise. +The methods are separated in Selenium 3 + +=cut + +sub get_property { + my ($self, $id, $property) = @_; + + return $self->_resolve_id($id)->get_property($property); } =item get_page_source($fh) From 3c490a644c69b47feeb519c532de370607bcb9a8 Mon Sep 17 00:00:00 2001 From: Yves Lavoie Date: Thu, 12 Jul 2018 11:19:32 -0400 Subject: [PATCH 2/2] Add travis configuration --- .travis.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c5baeb9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ + +language: perl +perl: + - "5.10" + - "5.12" + - "5.14" + - "5.16" + - "5.18" + - "5.20" + - "5.22" + - "5.24" + +install: + - dzil authordeps --missing | cpanm --no-skip-satisfied + - dzil listdeps --author --missing | cpanm --no-skip-satisfied + +script: + - dzil test --author --release