View | Details | Raw Unified | Return to bug 14536
Collapse All | Expand All

(-)a/t/lib/Page/Intra.pm (+20 lines)
Lines 179-184 sub doPasswordLogin { Link Here
179
    return $self; #After a succesfull password login, we are directed to the same page we tried to access.
179
    return $self; #After a succesfull password login, we are directed to the same page we tried to access.
180
}
180
}
181
181
182
sub failPasswordLogin {
183
    my ($self, $username, $password) = @_;
184
    my $d = $self->getDriver();
185
    $self->debugTakeSessionSnapshot();
186
187
    my ($submitButton, $useridInput, $passwordInput) = $self->_getPasswordLoginElements();
188
    $useridInput->send_keys($username);
189
    $passwordInput->send_keys($password);
190
    $submitButton->click();
191
    $self->debugTakeSessionSnapshot();
192
193
    my $cookies = $d->get_all_cookies();
194
    my @cgisessid = grep {$_->{name} eq 'CGISESSID'} @$cookies;
195
196
    ok($d->get_title() =~ /Log in to Koha/ #Still in the login page
197
       , "Intra PasswordLogin failed");
198
199
    return $self; #After a successful password login, we are directed to the same page we tried to access.
200
}
201
182
sub doPasswordLogout {
202
sub doPasswordLogout {
183
    my ($self, $username, $password) = @_;
203
    my ($self, $username, $password) = @_;
184
    my $d = $self->getDriver();
204
    my $d = $self->getDriver();
(-)a/t/lib/Page/Opac.pm (-4 / +19 lines)
Lines 160-165 sub doPasswordLogin { Link Here
160
    return $self; #After a succesfull password login, we are directed to the same page we tried to access.
160
    return $self; #After a succesfull password login, we are directed to the same page we tried to access.
161
}
161
}
162
162
163
sub failPasswordLogin {
164
    my ($self, $username, $password) = @_;
165
    my $d = $self->getDriver();
166
    $self->debugTakeSessionSnapshot();
167
168
    my ($submitButton, $useridInput, $passwordInput) = $self->_getPasswordLoginElements();
169
    $useridInput->send_keys($username);
170
    $passwordInput->send_keys($password);
171
    $submitButton->click();
172
    $self->debugTakeSessionSnapshot();
173
174
    ok($d->get_title() =~ /Log in to your account/ #Still in the login page
175
       , "Opac PasswordLogin failed");
176
177
    return $self; #After a successful password login, we are directed to the same page we tried to access.
178
}
179
163
sub doPasswordLogout {
180
sub doPasswordLogout {
164
    my ($self, $username, $password) = @_;
181
    my ($self, $username, $password) = @_;
165
    my $d = $self->getDriver();
182
    my $d = $self->getDriver();
Lines 172-182 sub doPasswordLogout { Link Here
172
    $self->debugTakeSessionSnapshot();
189
    $self->debugTakeSessionSnapshot();
173
190
174
    $headerElements = $self->_getHeaderRegionActionElements(); #Take the changed header elements
191
    $headerElements = $self->_getHeaderRegionActionElements(); #Take the changed header elements
175
    my $txt = $headerElements->{login}->get_text();
176
    ok(($headerElements->{login}->get_text() =~ /Log in/ ||
192
    ok(($headerElements->{login}->get_text() =~ /Log in/ ||
177
        $d->get_title() =~ /Log in to your account/), "Opac Header PasswordLogout succeeded");
193
        $d->get_title() =~ /Log in to your account/), "Opac Header PasswordLogout succeeded");
178
    return t::lib::Page::Opac::OpacMain->rebrandFromPageObject($self);
194
179
        ok((), "PasswordLogout succeeded");
195
    ok((), "PasswordLogout succeeded");
180
    return t::lib::Page::Opac::OpacMain->rebrandFromPageObject($self);
196
    return t::lib::Page::Opac::OpacMain->rebrandFromPageObject($self);
181
}
197
}
182
198
183
- 

Return to bug 14536