[libweasel-perl] 08/24: * Miscelaneous Element fixes

Robert James Clay jame at rocasa.us
Tue Aug 15 19:16:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

jame-guest pushed a commit to tag v0.02
in repository libweasel-perl.

commit 9d2a9bada0e03c3b5e2834bdc2a6a5f9aee7da29
Author: Erik Huelsmann <ehuels at gmail.com>
Date:   Thu Jun 16 10:23:07 2016 +0200

    * Miscelaneous Element fixes
---
 lib/Weasel/Element.pm          | 11 +++++------
 lib/Weasel/Element/Document.pm |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/Weasel/Element.pm b/lib/Weasel/Element.pm
index 3416236..b0ca329 100644
--- a/lib/Weasel/Element.pm
+++ b/lib/Weasel/Element.pm
@@ -10,7 +10,7 @@ Weasel::Element - The base HTML/Widget element class
 =head1 SYNOPSIS
 
    my $element = $session->page->find("./input[\@name='phone']");
-   my $value = $element->send_keys('555-885-321'
+   my $value = $element->send_keys('555-885-321');
 
 =head1 DESCRIPTION
 
@@ -54,10 +54,9 @@ has _id => (is => 'ro',
 =cut
 
 sub find {
-    my $self = shift @_;
-    my @rv = $self->find_all(@_);
+    my ($self, @args) = @_;
 
-    return shift @rv;
+    return $self->session->find($self, @args);
 }
 
 =item find_all($locator [, $scheme])
@@ -65,10 +64,10 @@ sub find {
 =cut
 
 sub find_all {
-    my ($self, $locator, $scheme) = @_;
+    my ($self, @args) = @_;
 
     # expand $locator based on framework plugins (e.g. Dojo)
-    return $self->session->find_all($self, $locator, $scheme);
+    return $self->session->find_all($self, @args);
 }
 
 =item click()
diff --git a/lib/Weasel/Element/Document.pm b/lib/Weasel/Element/Document.pm
index 2cae418..97a39f8 100644
--- a/lib/Weasel/Element/Document.pm
+++ b/lib/Weasel/Element/Document.pm
@@ -32,7 +32,7 @@ extends 'Weasel::Element';
 =cut
 
 has '+_id' => (required => 0,
-               default => '//html');
+               default => '/html');
 
 =back
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libweasel-perl.git



More information about the Pkg-perl-cvs-commits mailing list