[libweasel-perl] 12/24: * Implement two more APIs and add debugging aids (for now)

Robert James Clay jame at rocasa.us
Tue Aug 15 19:16:08 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 c0fe9cc3a22b5f031b988827298b60654d7ca91c
Author: Erik Huelsmann <ehuels at gmail.com>
Date:   Fri Jun 17 10:43:18 2016 +0200

    * Implement two more APIs and add debugging aids (for now)
---
 lib/Weasel/Session.pm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/lib/Weasel/Session.pm b/lib/Weasel/Session.pm
index 7645bdf..9d71b1b 100644
--- a/lib/Weasel/Session.pm
+++ b/lib/Weasel/Session.pm
@@ -104,6 +104,16 @@ sub _page_builder {
 
 =over
 
+=item click([$element])
+
+=cut
+
+sub click {
+    my ($self, $element) = @_;
+
+    $self->driver->click(($element) ? $element->_id : undef);
+}
+
 =item find($element, $pattern, $args)
 
 =cut
@@ -119,6 +129,7 @@ sub find {
         }
         catch {
             ###TODO add logger statement warning of consumed error
+            print STDERR $_ . "\n";
         };
         return $rv = shift @rv;
 
@@ -140,6 +151,8 @@ sub find_all {
         $self->driver->find_all($element->_id,
                                 $expanded_pattern,
                                 $args{scheme});
+    print STDERR "found " . scalar(@rv) . " elements for $pattern " . (join(', ', %args)) . "\n";
+    print STDERR ' - ' . ref($_) . "\n" for (@rv);
     return wantarray ? @rv : \@rv;
 }
 
@@ -170,6 +183,16 @@ sub screenshot {
     $self->driver->screenshot($fh);
 }
 
+=item send_keys($element, @keys)
+
+=cut
+
+sub send_keys {
+    my ($self, $element, @keys) = @_;
+
+    $self->driver->send_keys($element->_id, @keys);
+}
+
 =item wait_for($callback)
 
 Waits until $callback->() returns true, or C<wait_timeout> expires

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