Skip to content

Implement key_up and key_down to allow mouse and keyboard combinations #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
** 0.13 / 2021-04-02
** 0.13 / 2021-06-12
- Implement key_up and key_down to allow mouse and keyboard combinations

** 0.12 / 2021-04-05
- Properly fix JSONWIRE compatibility with FF by letting
get_attribute try to separate attributes and properties on browsers
which allows it and fallback on attributes only on failure.

** 0.12 / 2021-04-01
- Move Continuous Integration tests to Github Actions

** 0.11 / 2020-06-17
Expand Down
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = Weasel-Driver-Selenium2
abstract = PHP's Mink inspired multi-protocol web-testing library for Perl
version = 0.12
version = 0.13
author = Erik Huelsmann <[email protected]>
copyright_holder = Erik Huelsmann
main_module = lib/Weasel/Driver/Selenium2.pm
Expand Down
30 changes: 30 additions & 0 deletions lib/Weasel/Driver/Selenium2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,36 @@ sub send_keys {
return $self->_resolve_id($element_id)->send_keys(@keys);
}

=item key_up($element_id, @keys)

=cut

sub key_up {
my ($self, $element_id, @keys) = @_;

if (defined $element_id) {
return $self->_resolve_id($element_id)->key_up(@keys);
}
else {
return $self->_driver->key_up(@keys);
}
}

=item key_down($element_id, @keys)

=cut

sub key_down {
my ($self, $element_id, @keys) = @_;

if (defined $element_id) {
return $self->_resolve_id($element_id)->key_down(@keys);
}
else {
return $self->_driver->key_down(@keys);
}
}

=item tag_name($elem)

=cut
Expand Down