Lines 23-31
use Modern::Perl;
Link Here
|
23 |
|
23 |
|
24 |
use C4::Context; |
24 |
use C4::Context; |
25 |
|
25 |
|
26 |
use Test::More tests => 1; |
26 |
use Test::More tests => 3; |
27 |
|
27 |
|
28 |
use t::lib::Selenium; |
28 |
use t::lib::Selenium; |
|
|
29 |
use t::lib::TestBuilder; |
30 |
|
31 |
my $builder = t::lib::TestBuilder->new; |
29 |
|
32 |
|
30 |
my $login = $ENV{KOHA_USER} || 'koha'; |
33 |
my $login = $ENV{KOHA_USER} || 'koha'; |
31 |
|
34 |
|
Lines 67-78
SKIP: {
Link Here
|
67 |
}; |
70 |
}; |
68 |
|
71 |
|
69 |
{ # Circulation/fine rules |
72 |
{ # Circulation/fine rules |
|
|
73 |
my $itype = $builder->build_object({ class => "Koha::ItemTypes" }); |
70 |
$driver->get($mainpage); |
74 |
$driver->get($mainpage); |
71 |
$s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ) |
75 |
$s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ) |
72 |
; # Koha administration |
76 |
; # Koha administration |
73 |
$s->click( { href => '/admin/smart-rules.pl', main_class => 'main container-fluid' } ) |
77 |
$s->click( { href => '/admin/smart-rules.pl', main_class => 'main container-fluid' } ) |
74 |
; # Circulation and fines rules |
78 |
; # Circulation and fines rules |
75 |
# TODO Create smart navigation here |
79 |
my $elt = $driver->find_element('//tr[@id="edit_row"]/td/select[@id="matrixitemtype"]/option[@value="'.$itype->itemtype.'"]'); |
|
|
80 |
is( $elt->get_text(),$itype->description,"Our new itemtype is in the list"); |
81 |
$elt->click(); |
82 |
$elt = $driver->find_element('//tr[@id="edit_row"]/td[@class="actions"]/button[@type="submit"]'); |
83 |
$elt->click(); |
84 |
$elt = $driver->find_elements('//table[@id="default-circulation-rules"]/tbody/tr/td[contains(text(),"'.$itype->description.'")]/following-sibling::td/span[text() = "Unlimited"]'); |
85 |
is( @$elt,2,"We have unlimited checkouts"); |
86 |
#Clean up |
87 |
Koha::IssuingRules->find({itemtype=>$itype->itemtype})->delete(); |
88 |
$itype->delete; |
89 |
# TODO Create more smart rules navigation here |
76 |
}; |
90 |
}; |
77 |
|
91 |
|
78 |
{ # Biblio frameworks |
92 |
{ # Biblio frameworks |
79 |
- |
|
|