Lines 23-31
Link Here
|
23 |
# Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null & |
23 |
# Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null & |
24 |
# DISPLAY=:1 java -jar $SELENIUM_PATH |
24 |
# DISPLAY=:1 java -jar $SELENIUM_PATH |
25 |
# |
25 |
# |
26 |
# Remove the rentalcharge: |
|
|
27 |
# % UPDATE itemtypes SET rentalcharge = 0; |
28 |
# |
29 |
# Then you can execute the test file. |
26 |
# Then you can execute the test file. |
30 |
# |
27 |
# |
31 |
# If you get: |
28 |
# If you get: |
Lines 50-55
my $login = 'koha';
Link Here
|
50 |
my $password = 'koha'; |
47 |
my $password = 'koha'; |
51 |
my $base_url= ( $ENV{KOHA_INTRANET_URL} || 'http://'.C4::Context->preference("staffClientBaseURL") ) . "/cgi-bin/koha/"; |
48 |
my $base_url= ( $ENV{KOHA_INTRANET_URL} || 'http://'.C4::Context->preference("staffClientBaseURL") ) . "/cgi-bin/koha/"; |
52 |
|
49 |
|
|
|
50 |
|
53 |
my $number_of_biblios_to_insert = 3; |
51 |
my $number_of_biblios_to_insert = 3; |
54 |
our $sample_data = { |
52 |
our $sample_data = { |
55 |
category => { |
53 |
category => { |
Lines 64-69
our $sample_data = {
Link Here
|
64 |
userid => 'test_username', |
62 |
userid => 'test_username', |
65 |
password => 'password', |
63 |
password => 'password', |
66 |
password2 => 'password' |
64 |
password2 => 'password' |
|
|
65 |
|
66 |
}, |
67 |
itemtype => { |
68 |
itemtype => 'IT4TEST', |
69 |
description => 'Just an itemtype for tests', |
70 |
rentalcharge => 0, |
71 |
notforloan => 0, |
67 |
}, |
72 |
}, |
68 |
}; |
73 |
}; |
69 |
our ( $borrowernumber, $start, $prev_time, $cleanup_needed ); |
74 |
our ( $borrowernumber, $start, $prev_time, $cleanup_needed ); |
Lines 128-135
SKIP: {
Link Here
|
128 |
|
133 |
|
129 |
time_diff("add biblio"); |
134 |
time_diff("add biblio"); |
130 |
|
135 |
|
131 |
my $itemtype = $dbh->selectcol_arrayref(q|SELECT itemtype FROM itemtypes|); |
136 |
my $itemtype = $sample_data->{itemtype}; |
132 |
$itemtype = $itemtype->[0]; |
137 |
$dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan}); |
133 |
|
138 |
|
134 |
for my $biblionumber ( @biblionumbers ) { |
139 |
for my $biblionumber ( @biblionumbers ) { |
135 |
$driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber"); |
140 |
$driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber"); |
Lines 149-156
SKIP: {
Link Here
|
149 |
like( $driver->get_title(), qr($biblionumber.*Items) ); |
154 |
like( $driver->get_title(), qr($biblionumber.*Items) ); |
150 |
|
155 |
|
151 |
$dbh->do(q|UPDATE items SET notforloan=0 WHERE biblionumber=?|, {}, $biblionumber ); |
156 |
$dbh->do(q|UPDATE items SET notforloan=0 WHERE biblionumber=?|, {}, $biblionumber ); |
152 |
$dbh->do(q|UPDATE biblioitems SET itemtype=? WHERE biblionumber=?|, {}, $itemtype, $biblionumber); |
157 |
$dbh->do(q|UPDATE biblioitems SET itemtype=? WHERE biblionumber=?|, {}, $itemtype->{itemtype}, $biblionumber); |
153 |
$dbh->do(q|UPDATE items SET itype=? WHERE biblionumber=?|, {}, $itemtype, $biblionumber); |
158 |
$dbh->do(q|UPDATE items SET itype=? WHERE biblionumber=?|, {}, $itemtype->{itemtype}, $biblionumber); |
154 |
} |
159 |
} |
155 |
|
160 |
|
156 |
time_diff("add items"); |
161 |
time_diff("add items"); |
Lines 217-222
sub cleanup {
Link Here
|
217 |
for my $i ( 1 .. $number_of_biblios_to_insert ) { |
222 |
for my $i ( 1 .. $number_of_biblios_to_insert ) { |
218 |
$dbh->do(qq|DELETE items, biblio FROM biblio INNER JOIN items ON biblio.biblionumber = items.biblionumber WHERE biblio.title = "test biblio$i"|); |
223 |
$dbh->do(qq|DELETE items, biblio FROM biblio INNER JOIN items ON biblio.biblionumber = items.biblionumber WHERE biblio.title = "test biblio$i"|); |
219 |
}; |
224 |
}; |
|
|
225 |
$dbh->do(q|DELETE FROM itemtypes WHERE itemtype=?|, undef, $sample_data->{itemtype}{itemtype}); |
220 |
} |
226 |
} |
221 |
|
227 |
|
222 |
sub time_diff { |
228 |
sub time_diff { |
223 |
- |
|
|