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-08-20 23:52:50 +0200
commit4a66989c7cf4bcb1afce0c4e39a3f1c87ef0e57c (patch)
treec96b05f8f3ca81ac7bbb8ad061fc0bab2d2fcc04 /qa/t/lib/QA/Util.pm
parent77468653f4f3e3285bc68e455b5b4e4265362aeb (diff)
downloadbugzilla-4a66989c7cf4bcb1afce0c4e39a3f1c87ef0e57c.tar.gz
bugzilla-4a66989c7cf4bcb1afce0c4e39a3f1c87ef0e57c.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__