|
Lines 142-148
SKIP: {
Link Here
|
| 142 |
}; |
142 |
}; |
| 143 |
|
143 |
|
| 144 |
subtest 'OPAC interface authentication' => sub { |
144 |
subtest 'OPAC interface authentication' => sub { |
| 145 |
plan tests => 7; |
145 |
plan tests => 11; |
| 146 |
|
146 |
|
| 147 |
my $mainpage = $s->opac_base_url . q|opac-main.pl|; |
147 |
my $mainpage = $s->opac_base_url . q|opac-main.pl|; |
| 148 |
|
148 |
|
|
Lines 159-164
SKIP: {
Link Here
|
| 159 |
# Using the modal |
159 |
# Using the modal |
| 160 |
$driver->find_element('//a[@class="nav-link login-link loginModal-trigger"]')->click; |
160 |
$driver->find_element('//a[@class="nav-link login-link loginModal-trigger"]')->click; |
| 161 |
$s->fill_form( { muserid => $patron->userid, mpassword => $password } ); |
161 |
$s->fill_form( { muserid => $patron->userid, mpassword => $password } ); |
|
|
162 |
|
| 163 |
is( |
| 164 |
$driver->find_element('//div[@id="loginModal"]//input[@id="mpassword"]')->get_attribute('type'), |
| 165 |
'password', |
| 166 |
'Password field is obscured initially' |
| 167 |
); |
| 168 |
|
| 169 |
$driver->find_element('//input[@id="show-password-toggle-checkbox-modal"]')->click; |
| 170 |
|
| 171 |
is( |
| 172 |
$driver->find_element('//div[@id="loginModal"]//input[@id="mpassword"]')->get_attribute('type'), |
| 173 |
'text', |
| 174 |
'Password field is shown' |
| 175 |
); |
| 176 |
|
| 177 |
$driver->find_element('//input[@id="show-password-toggle-checkbox-modal"]')->click; |
| 178 |
|
| 162 |
$driver->find_element('//div[@id="loginModal"]//input[@type="submit"]')->click; |
179 |
$driver->find_element('//div[@id="loginModal"]//input[@type="submit"]')->click; |
| 163 |
like( $driver->get_title, qr(Koha online catalog), 'Patron without permission should be able to login to the OPAC using the modal' ); |
180 |
like( $driver->get_title, qr(Koha online catalog), 'Patron without permission should be able to login to the OPAC using the modal' ); |
| 164 |
$driver->find_element('//div[@id="userdetails"]'); |
181 |
$driver->find_element('//div[@id="userdetails"]'); |
|
Lines 190-195
SKIP: {
Link Here
|
| 190 |
|
207 |
|
| 191 |
# Using the form on the right |
208 |
# Using the form on the right |
| 192 |
$s->fill_form( { userid => $patron->userid, password => $password } ); |
209 |
$s->fill_form( { userid => $patron->userid, password => $password } ); |
|
|
210 |
|
| 211 |
is( |
| 212 |
$driver->find_element('//div[@id="login"]//input[@id="password"]')->get_attribute('type'), |
| 213 |
'password', |
| 214 |
'Password field is obscured initially' |
| 215 |
); |
| 216 |
|
| 217 |
$driver->find_element('//input[@id="show-password-toggle-checkbox-main"]')->click; |
| 218 |
|
| 219 |
is( |
| 220 |
$driver->find_element('//div[@id="login"]//input[@id="password"]')->get_attribute('type'), |
| 221 |
'text', |
| 222 |
'Password field is shown' |
| 223 |
); |
| 224 |
|
| 225 |
$driver->find_element('//input[@id="show-password-toggle-checkbox-main"]')->click; |
| 193 |
$s->submit_form; |
226 |
$s->submit_form; |
| 194 |
$driver->find_element('//div[@id="userdetails"]'); |
227 |
$driver->find_element('//div[@id="userdetails"]'); |
| 195 |
like( $driver->get_title, qr(Your library home), 'Patron without permissions should be able to login to the OPAC using the form on the right'); |
228 |
like( $driver->get_title, qr(Your library home), 'Patron without permissions should be able to login to the OPAC using the form on the right'); |
| 196 |
- |
|
|