Bugzilla – Attachment 53194 Details for
Bug 3311
Statistical reports should error if row and column aren't selected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3311: Testing Cases
Bug-3311-Testing-Cases.patch (text/plain), 4.62 KB, created by
Nicole C. Engard
on 2016-07-07 19:06:49 UTC
(
hide
)
Description:
Bug 3311: Testing Cases
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2016-07-07 19:06:49 UTC
Size:
4.62 KB
patch
obsolete
>From a79a2e7d434bba92b68e478f302373d6c73054eb Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 23 Jun 2016 21:08:00 -0400 >Subject: [PATCH] Bug 3311: Testing Cases > >There was no form of testing for the page. In order to test >the perl-side of the changes, I just went to a variety of >URLs to see if it will blow up. > >TEST PLAN >--------- >1) Apply this patch >2) At the bash prompt, export KOHA_INTRANET_URL=http://localhost:8080/ > -- Or whatever yours is. With or without the trailing / >3) prove -v t/db_dependent/www/catalogue_stats.t > -- before applying the other patch, there should be failures. >4) Apply both patches >5) prove -v t/db_dependent/www/catalogue_stats.t > -- there should be no failures now. >6) run koha qa test tools > >Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com> >--- > t/db_dependent/www/catalogue_stats.t | 111 +++++++++++++++++++++++++++++++++++ > 1 file changed, 111 insertions(+) > create mode 100644 t/db_dependent/www/catalogue_stats.t > >diff --git a/t/db_dependent/www/catalogue_stats.t b/t/db_dependent/www/catalogue_stats.t >new file mode 100644 >index 0000000..5864fe2 >--- /dev/null >+++ b/t/db_dependent/www/catalogue_stats.t >@@ -0,0 +1,111 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright (C) 2016 Mark Tompsett >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More; >+use Test::WWW::Mechanize; >+use XML::Simple; >+ >+my $koha_conf = $ENV{KOHA_CONF}; >+my $xml = XMLin($koha_conf); >+ >+my $user = $ENV{KOHA_USER} || $xml->{config}->{user}; >+my $password = $ENV{KOHA_PASS} || $xml->{config}->{pass}; >+my $intranet = $ENV{KOHA_INTRANET_URL}; >+ >+# test KOHA_INTRANET_URL is set >+if ( not defined $intranet ) { >+ plan skip_all => >+ "Tests skip. You must set env. variable KOHA_INTRANET_URL to do tests\n"; >+} >+ >+$intranet =~ s/\/$//xsm; >+ >+test_row_column_selection(); >+ >+done_testing(); >+ >+sub test_row_column_selection { >+ >+ my $agent = Test::WWW::Mechanize->new( autocheck => 1 ); >+ >+ $agent->get_ok( "$intranet/cgi-bin/koha/mainpage.pl", >+ 'connect to intranet' ); >+ $agent->form_name('loginform'); >+ $agent->field( 'password', $password ); >+ $agent->field( 'userid', $user ); >+ $agent->field( 'branch', q{} ); >+ $agent->click_ok( q{}, 'login to staff client' ); >+ >+ $agent->get_ok( "$intranet/cgi-bin/koha/mainpage.pl", 'load main page' ); >+ >+ $agent->follow_link_ok( { url_regex => qr/reports-home/xsmi }, >+ 'open reports module' ); >+ $agent->follow_link_ok( { url_regex => qr/catalogue_stats/xsmi }, >+ 'go to Catalog statistics' ); >+ >+ my $base_url = $agent->uri(); >+ note "Base URL: $base_url\n"; >+ my @test_urls = ( >+ '?Column=&Line=', >+ '?Column=test&Line=', >+ '?Column=items.itype&Line=', >+ '?Column=&Line=&do_it=1', >+ '?Column=test&Line=&do_it=1', >+ '?Column=items.itype&Line=&do_it=1', >+ '?Column=&Line=test', >+ '?Column=test&Line=test', >+ '?Column=items.itype&Line=test', >+ '?Column=&Line=test&do_it=1', >+ '?Column=test&Line=test&do_it=1', >+ '?Column=items.itype&Line=test&do_it=1', >+ '?Column=&Line=publishercode', >+ '?Column=test&Line=publishercode', >+ '?Column=items.itype&Line=publishercode', >+ '?Column=&Line=publishercode&do_it=1', >+ '?Column=test&Line=publishercode&do_it=1', >+ '?Column=items.itype&Line=publishercode&do_it=1', >+ '?Line=', >+ '?Line=&do_it=1', >+ '?Line=test', >+ '?Line=test&do_it=1', >+ '?Line=publishercode', >+ '?Line=publishercode&do_it=1', >+ '?Column=', >+ '?Column=&do_it=1', >+ '?Column=test', >+ '?Column=test&do_it=1', >+ '?Column=publishercode', >+ '?Column=publishercode&do_it=1', >+ q{?}, >+ '?do_it=1', >+ ); >+ >+ foreach my $test_url (@test_urls) { >+ my $current_url = $base_url . q{/} . $test_url; >+ eval { >+ $agent->get_ok( $current_url, 'Checking ' . $test_url ); >+ } || fail('Checking ' . $test_url . ' failed!'); >+ } >+ >+ return; >+} >+ >+1; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3311
:
52775
|
52776
|
52777
|
52778
|
52779
|
53194
|
53195
|
53291
|
62533
|
62541
|
62623
|
62624
|
62630
|
62658
|
62659
|
62776
|
62777
|
62793
|
62794
|
62795
|
62796
|
62797
|
62798
|
62799
|
62800
|
62801
|
62802