Bug 25449: Fix basic_workflow.t

We need to create an itemtype for the biblio, then the item form will
have 942$c prefilled by default

STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
        /usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
        (eval 1726):1 in Selenium::Remote::Driver::__ANON__
        (eval 1728):2 in Selenium::Remote::Driver::__ANON__
        /usr/share/perl5/Selenium/Remote/Driver.pm:953 in Selenium::Remote::Driver::_execute_command
        t/db_dependent/selenium/basic_workflow.t:224 in Selenium::Remote::Driver::get_title

Error while executing command: unexpected alert open: Dismissed user prompt dialog: Form not submitted because of the following problem(s)
------------------------------------------------------------------------------------

- 1 mandatory fields empty (highlighted) at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-07-20 17:39:22 +02:00 committed by Tomas Cohen Arazi
parent ed83d77445
commit 0800662227
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -130,6 +130,8 @@ SKIP: {
$borrowernumber = $dbh->selectcol_arrayref(q|SELECT borrowernumber FROM borrowers WHERE userid=?|, {}, $sample_data->{patron}{userid} )->[0];
my $itemtype = $sample_data->{itemtype};
my @biblionumbers;
for my $i ( 1 .. $number_of_biblios_to_insert ) {
my $biblio = MARC::Record->new();
@ -138,11 +140,13 @@ SKIP: {
$biblio->append_fields(
MARC::Field->new('200', ' ', ' ', a => 'test biblio '.$i),
MARC::Field->new('200', ' ', ' ', f => 'test author '.$i),
MARC::Field->new('200', ' ', ' ', b => $itemtype->{itemtype}),
);
} else {
$biblio->append_fields(
MARC::Field->new('245', ' ', ' ', a => 'test biblio '.$i),
MARC::Field->new('100', ' ', ' ', a => 'test author '.$i),
MARC::Field->new('942', ' ', ' ', c => $itemtype->{itemtype}),
);
}
my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, '');
@ -151,8 +155,6 @@ SKIP: {
time_diff("add biblio");
my $itemtype = $sample_data->{itemtype};
my $issuing_rules = $sample_data->{issuingrule};
Koha::CirculationRules->set_rules(
{
@ -204,6 +206,11 @@ SKIP: {
$v = strftime("%Y-%m-%d", localtime);
$effective_input = $driver->find_element('//div[@id="subfield952w"]/input[@class="input_marceditor flatpickr-input"]');
}
elsif (
$id =~ m|^tag_952_subfield_y| # itemtype
) {
next; # auto-filled
}
elsif (
$id =~ m|^tag_952_subfield_d| # dateaccessioned
) {