Bug 19243: Amended Selenium test to add the creation of patron category and authorise...
authorAlex Buckley <alexbuckley@catalyst.net.nz>
Thu, 14 Dec 2017 23:07:30 +0000 (23:07 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 13 Feb 2018 19:56:24 +0000 (16:56 -0300)
Sponsored-By: Catalyst IT

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

t/db_dependent/selenium/administration_tasks.t

index 716ce53..14feb25 100644 (file)
@@ -32,6 +32,7 @@ my $login = $ENV{KOHA_USER} || 'koha';
 my $itemtype      = 'UT_DVD';
 my $frameworkcode = 'UTFW';     # frameworkcode is only 4 characters max!
 my $branchcode    = 'UT_BC';
+my $categoryname = 'Test';
 our ($cleanup_needed);
 
 SKIP: {
@@ -46,7 +47,6 @@ SKIP: {
     $driver->get($mainpage);
     like( $driver->get_title(), qr(Log in to Koha), );
     $s->auth;
-
     { # Item types
         # Navigate to the Administration area and create an item type
         $s->click( { href => '/admin/admin-home.pl', main => 'doc3' } )
@@ -126,6 +126,40 @@ SKIP: {
         );     # Delete
     };
 
+    { #Authorized values
+        $driver->get($mainpage);
+        $s->click( { href => '/admin/admin-home.pl', main => 'doc3' } ); #Koha administration
+
+        $s->click( { href => '/admin/authorised_values.pl', main => 'doc' } ); #Authorized values
+
+        $s->click( { href => '/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=Adult', main => 'doc3' } ); # New category
+        $s->fill_form( { authorised_value => 'Hardover', lib => 'Hardcover book'} );
+        $s->submit_form;
+
+        $s->click(
+            {
+                href => '/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=Adult&id=400',
+                main => 'doc3'
+            }
+        );
+    };
+
+    { #Patron categories
+        $driver->get($mainpage);
+        $s->click( { href => '/cgi-bin/koha/admin/categories.pl', main => 'doc3' } ); #Koha administration
+        $s->click( { href => '/cgi-bin/koha/admin/categories.pl?op=add_form', main => 'doc' } ); #New patron category
+
+        $s->fill_form( { categorycode => 'Test', description => 'Test category', enrolmentperiod => 12, category_type => 'Adult' } );
+        $s->submit_form;
+
+        $s->click(
+            {
+                href => '/cgi-bin/koha/admin/categories.pl?op=delete_confirm&categorycode=TEST',
+                main => 'doc3'
+            }
+        );
+    };
+
     $driver->quit();
 }