Bug 17600: Standardize our EXPORT_OK
[srvgit] / t / db_dependent / selenium / basic_workflow.t
index a988bb8..4bf121b 100755 (executable)
@@ -37,7 +37,7 @@ use Modern::Perl;
 use Time::HiRes qw(gettimeofday);
 use POSIX qw(strftime);
 use C4::Context;
-use C4::Biblio qw( AddBiblio ); # We shouldn't use it
+use C4::Biblio qw( AddBiblio );
 
 use Koha::CirculationRules;
 
@@ -177,10 +177,9 @@ SKIP: {
         $driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber");
         like( $driver->get_title(), qr(test biblio \d+ by test author), );
         my $form = $driver->find_element('//form[@name="f"]');
-        my $inputs = $driver->find_child_elements($form, '//input[@type="text"]');
+        # select the text inputs that don't have display:none
+        my $inputs = $driver->find_child_elements($form, '/.//*[not(self::node()[contains(@style,"display:none")])]/*[@type="text"]');
         for my $input ( @$inputs ) {
-            next if $input->is_hidden();
-
             my $id = $input->get_attribute('id');
             next unless $id =~ m|^tag_952_subfield|;
 
@@ -206,7 +205,12 @@ SKIP: {
             elsif (
                 $id =~ m|^tag_952_subfield_d| # dateaccessioned
             ) {
-                $v = ""; # The input has been prefilled with %Y-%m-%d already
+                next; # The input has been prefilled with %Y-%m-%d already
+            }
+            elsif (
+                $id =~ m|^tag_952_subfield_3| # materials
+            ) {
+                $v = ""; # We don't want the checkin/checkout to need confirmation if CircConfirmItemParts is on
             }
             else {
                 $v = 't_value_bib' . $biblionumber;
@@ -215,7 +219,7 @@ SKIP: {
         }
 
         $driver->find_element('//input[@name="add_submit"]')->click;
-        like( $driver->get_title(), qr($biblionumber.*Items) );
+        like( $driver->get_title(), qr(Items.*Record #$biblionumber) );
 
         $dbh->do(q|UPDATE items SET notforloan=0 WHERE biblionumber=?|, {}, $biblionumber );
         $dbh->do(q|UPDATE biblioitems SET itemtype=? WHERE biblionumber=?|, {}, $itemtype->{itemtype}, $biblionumber);