diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-09-19 00:19:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-19 00:19:03 +0200 |
commit | b8b2a943056adbb112474df7bdf766970a56b2dc (patch) | |
tree | ac62e6bcd7d795066ce66256a6fdf2d1be101514 /qa/t/lib/QA | |
parent | 2f3ca2822570ae271ca4603b5d3de119b40d9eb8 (diff) | |
download | bugzilla-b8b2a943056adbb112474df7bdf766970a56b2dc.tar.gz bugzilla-b8b2a943056adbb112474df7bdf766970a56b2dc.tar.xz |
Bug 1455495 - Replace apache with Mojolicious
Diffstat (limited to 'qa/t/lib/QA')
-rw-r--r-- | qa/t/lib/QA/Util.pm | 28 |
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__ |