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 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)