summaryrefslogtreecommitdiffstats
path: root/qa/t/lib/QA/Util.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-04-04 05:05:04 +0200
committerDylan William Hardison <dylan@hardison.net>2018-07-31 18:57:16 +0200
commit6df945da5900da86203e0527816690cb1d52c574 (patch)
tree2bd1fe5aa1aac5f239c32328eece0e3af400feba /qa/t/lib/QA/Util.pm
parent8b75f8e691309ec68e5de1cbdf77f6e8b2b305f8 (diff)
downloadbugzilla-6df945da5900da86203e0527816690cb1d52c574.tar.gz
bugzilla-6df945da5900da86203e0527816690cb1d52c574.tar.xz
Bug 1455495 - Replace apache with Mojolicious
Diffstat (limited to 'qa/t/lib/QA/Util.pm')
-rw-r--r--qa/t/lib/QA/Util.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/qa/t/lib/QA/Util.pm b/qa/t/lib/QA/Util.pm
index 5d041d560..bf9151fee 100644
--- a/qa/t/lib/QA/Util.pm
+++ b/qa/t/lib/QA/Util.pm
@@ -18,6 +18,7 @@ use Sys::Hostname qw(hostname);
use Socket qw(inet_ntoa);
use WWW::Selenium::Util qw(server_is_running);
use URI;
+use URI::QueryParam;
# Fixes wide character warnings
BEGIN {
@@ -50,6 +51,7 @@ use base qw(Exporter);
get_selenium
get_rpc_clients
+ check_page_load
WAIT_TIME
CHROME_MODE
@@ -396,6 +398,32 @@ sub set_parameters {
}
}
+my @ANY_KEYS = qw( t token );
+
+sub check_page_load {
+ my ($sel, $wait, $expected) = @_;
+ my $expected_uri = URI->new($expected);
+ $sel->wait_for_page_to_load_ok($wait);
+ my $uri = URI->new($sel->get_location);
+
+ foreach my $u ($expected_uri, $uri) {
+ $u->host('HOSTNAME');
+ foreach my $any_key (@ANY_KEYS) {
+ if ($u->query_param($any_key)) {
+ $u->query_param($any_key => '__ANYTHING__');
+ }
+ }
+ }
+
+ if ($expected_uri->query_param('id')) {
+ if ($expected_uri->query_param('id') eq '__BUG_ID__') {
+ $uri->query_param('id' => '__BUG_ID__');
+ }
+ }
+ my ($pkg, $file, $line) = caller;
+ is($uri, $expected_uri, "checking location on $file line $line");
+}
+
1;
__END__