Lines 59-68
subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub {
Link Here
|
59 |
$patron->set_password({ password => $password }); |
59 |
$patron->set_password({ password => $password }); |
60 |
$s->opac_auth( $patron->userid, $password ); |
60 |
$s->opac_auth( $patron->userid, $password ); |
61 |
my $elt = $driver->find_element('//span[@class="loggedinusername"]'); |
61 |
my $elt = $driver->find_element('//span[@class="loggedinusername"]'); |
62 |
is( $elt->get_attribute('data-branchcode'), $patron->library->branchcode, |
62 |
is( $elt->get_attribute('data-branchcode', 1), $patron->library->branchcode, |
63 |
"Since bug 20921 span.loggedinusername should contain data-branchcode" |
63 |
"Since bug 20921 span.loggedinusername should contain data-branchcode" |
|
|
64 |
# No idea why we need the second param of get_attribute(). As |
65 |
# data-branchcode is still there after page finished loading. |
64 |
); |
66 |
); |
65 |
is( $elt->get_attribute('data-borrowernumber'), $patron->borrowernumber, |
67 |
is( $elt->get_attribute('data-borrowernumber', 1), $patron->borrowernumber, |
66 |
"Since bug 20921 span.loggedinusername should contain data-borrowernumber" |
68 |
"Since bug 20921 span.loggedinusername should contain data-borrowernumber" |
67 |
); |
69 |
); |
68 |
push @cleanup, $patron, $patron->category, $patron->library; |
70 |
push @cleanup, $patron, $patron->category, $patron->library; |
Lines 168-178
subtest 'Display circulation table correctly' => sub {
Link Here
|
168 |
|
170 |
|
169 |
my @thead_th = $driver->find_elements('//table[@id="issues-table"]/thead/tr/th'); |
171 |
my @thead_th = $driver->find_elements('//table[@id="issues-table"]/thead/tr/th'); |
170 |
my $thead_length = 0; |
172 |
my $thead_length = 0; |
171 |
$thead_length += $_->get_attribute('colspan') || 0 for @thead_th; |
173 |
$thead_length += $_->get_attribute('colspan', 1) || 0 for @thead_th; |
172 |
|
174 |
|
173 |
my @tfoot_td = $driver->find_elements('//table[@id="issues-table"]/tfoot/tr/td'); |
175 |
my @tfoot_td = $driver->find_elements('//table[@id="issues-table"]/tfoot/tr/td'); |
174 |
my $tfoot_length = 0; |
176 |
my $tfoot_length = 0; |
175 |
$tfoot_length += $_->get_attribute('colspan') || 0 for @tfoot_td; |
177 |
$tfoot_length += $_->get_attribute('colspan', 1) || 0 for @tfoot_td; |
176 |
|
178 |
|
177 |
my @tbody_td = $driver->find_elements('//table[@id="issues-table"]/tbody/tr[2]/td'); |
179 |
my @tbody_td = $driver->find_elements('//table[@id="issues-table"]/tbody/tr[2]/td'); |
178 |
my $tbody_length = 0; |
180 |
my $tbody_length = 0; |
Lines 231-236
subtest 'XSS vulnerabilities in pagination' => sub {
Link Here
|
231 |
like( $second_page->get_attribute('href'), qr{category=2%22%3E%3Cscript%3Ealert%28%27booh%21%27%29%3C%2Fscript%3E}, 'The second page should display the variables and attributes correctly URI escaped' ); |
233 |
like( $second_page->get_attribute('href'), qr{category=2%22%3E%3Cscript%3Ealert%28%27booh%21%27%29%3C%2Fscript%3E}, 'The second page should display the variables and attributes correctly URI escaped' ); |
232 |
|
234 |
|
233 |
push @cleanup, $patron, $patron->category, $patron->library; |
235 |
push @cleanup, $patron, $patron->category, $patron->library; |
|
|
236 |
|
237 |
$driver->quit(); |
234 |
}; |
238 |
}; |
235 |
|
239 |
|
236 |
END { |
240 |
END { |