From 9b6ec1f545da1cc4088ddf9cc117747954e58e65 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 26 Feb 2016 17:57:55 +0000 Subject: Bug 1069799 - move the QA repository into the main repository r=LpSolit --- xt/selenium/shutdown.t | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 xt/selenium/shutdown.t (limited to 'xt/selenium/shutdown.t') diff --git a/xt/selenium/shutdown.t b/xt/selenium/shutdown.t new file mode 100644 index 000000000..8751cd614 --- /dev/null +++ b/xt/selenium/shutdown.t @@ -0,0 +1,77 @@ +# 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. + +use 5.10.1; +use strict; +use warnings; + +use FindBin qw($RealBin); +use lib "$RealBin/../lib"; + +use Test::More "no_plan"; + +use QA::Util; + +my ($sel, $config) = get_selenium(); + +log_in($sel, $config, 'admin'); +set_parameters($sel, { "General" => {shutdownhtml => {type => "text", + value => "I'm down (set by test_shutdown.t)" } + } }); + +# None of the following pages should be accessible when Bugzilla is down. + +my @pages = qw(admin attachment buglist chart colchange config createaccount + describecomponents describekeywords duplicates + editclassifications editcomponents editfields editflagtypes + editgroups editkeywords editmilestones editproducts editsettings + editusers editvalues editversions editwhines editworkflow + enter_bug index page post_bug process_bug query quips relogin + report reports request sanitycheck search_plugin show_activity + show_bug showdependencygraph showdependencytree summarize_time + token userprefs votes xmlrpc); + +foreach my $page (@pages) { + $sel->open_ok("/$config->{bugzilla_installation}/${page}.cgi"); + $sel->title_is("Bugzilla is Down"); +} + +# Those have parameters passed to the page, so we put them here separately. + +@pages = ("query.cgi?format=report-table", "query.cgi?format=report-graph", + "votes.cgi?action=show_user", "votes.cgi?action=show_bug"); + +foreach my $page (@pages) { + $sel->open_ok("/$config->{bugzilla_installation}/$page"); + $sel->title_is("Bugzilla is Down"); +} + +# Clear 'shutdownhtml', to re-enable Bugzilla. +# At this point, the admin has been logged out. We cannot use log_in(), +# nor set_parameters(), due to shutdownhtml being active. + +$sel->open_ok("/$config->{bugzilla_installation}/editparams.cgi"); +$sel->title_is("Log in to Bugzilla"); +$sel->type_ok("Bugzilla_login", $config->{admin_user_login}, "Enter admin login name"); +$sel->type_ok("Bugzilla_password", $config->{admin_user_passwd}, "Enter admin password"); +$sel->click_ok("log_in"); +$sel->wait_for_page_to_load_ok(WAIT_TIME); +$sel->title_is("Configuration: Required Settings"); +$sel->click_ok("link=General"); +$sel->wait_for_page_to_load_ok(WAIT_TIME); +$sel->title_is("Configuration: General"); +$sel->type_ok("shutdownhtml", ""); +$sel->click_ok('//input[@type="submit" and @value="Save Changes"]', undef, "Save Changes"); +$sel->wait_for_page_to_load_ok(WAIT_TIME); +$sel->title_is("Parameters Updated"); + +# Accessing index.cgi should work again now. + +$sel->click_ok("link=Home"); +$sel->wait_for_page_to_load_ok(WAIT_TIME); +$sel->title_is("Bugzilla Main Page"); +logout($sel); -- cgit v1.2.3-24-g4f1b