Skip to content

Instantly share code, notes, and snippets.

@dklawren
Created February 8, 2019 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dklawren/bc926546f4c9fb129876ee89e9dc13bd to your computer and use it in GitHub Desktop.
Save dklawren/bc926546f4c9fb129876ee89e9dc13bd to your computer and use it in GitHub Desktop.
Bugzilla::Test::Selenium::Remote::Driver
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
package Bugzilla::Test::Selenium::Remote::Driver;
use 5.10.1;
use Moo;
use Test::More;
extends qw(Test::Selenium::Remote::Driver);
sub open_ok {
my ($self, $url) = @_;
return $self->get_ok($url);
}
sub type_ok {
my ($self, $id, $text) = @_;
my $el
= $self->find_element(qq{//*[\@id="$id"]}, 'xpath');
$el->send_keys_ok($text);
}
sub wait_for_page_to_load_ok {
my ($self, $timeout) = @_;
ok($self->set_timeout('page load', $timeout));
}
sub wait_for_page_to_load {
my ($self, $timeout) = @_;
$self->set_timeout('page load', $timeout);
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment