Bugzilla – Attachment 42433 Details for
Bug 14536
PageObject-pattern base implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14536 - PageObject squashable
Bug-14536---PageObject-squashable.patch (text/plain), 3.07 KB, created by
Olli-Antti Kivilahti
on 2015-09-07 15:16:38 UTC
(
hide
)
Description:
Bug 14536 - PageObject squashable
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2015-09-07 15:16:38 UTC
Size:
3.07 KB
patch
obsolete
>From 3588629a41013c13875264c24fd127c7e6a1b429 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Mon, 7 Sep 2015 18:16:11 +0300 >Subject: [PATCH] Bug 14536 - PageObject squashable > >--- > t/lib/Page/Intra.pm | 20 ++++++++++++++++++++ > t/lib/Page/Opac.pm | 22 +++++++++++++++++++--- > 2 files changed, 39 insertions(+), 3 deletions(-) > >diff --git a/t/lib/Page/Intra.pm b/t/lib/Page/Intra.pm >index 79636f3..5f472d3 100644 >--- a/t/lib/Page/Intra.pm >+++ b/t/lib/Page/Intra.pm >@@ -179,6 +179,26 @@ sub doPasswordLogin { > return $self; #After a succesfull password login, we are directed to the same page we tried to access. > } > >+sub failPasswordLogin { >+ my ($self, $username, $password) = @_; >+ my $d = $self->getDriver(); >+ $self->debugTakeSessionSnapshot(); >+ >+ my ($submitButton, $useridInput, $passwordInput) = $self->_getPasswordLoginElements(); >+ $useridInput->send_keys($username); >+ $passwordInput->send_keys($password); >+ $submitButton->click(); >+ $self->debugTakeSessionSnapshot(); >+ >+ my $cookies = $d->get_all_cookies(); >+ my @cgisessid = grep {$_->{name} eq 'CGISESSID'} @$cookies; >+ >+ ok($d->get_title() =~ /Log in to Koha/ #Still in the login page >+ , "Intra PasswordLogin failed"); >+ >+ return $self; #After a successful password login, we are directed to the same page we tried to access. >+} >+ > sub doPasswordLogout { > my ($self, $username, $password) = @_; > my $d = $self->getDriver(); >diff --git a/t/lib/Page/Opac.pm b/t/lib/Page/Opac.pm >index b7d805d..963f713 100644 >--- a/t/lib/Page/Opac.pm >+++ b/t/lib/Page/Opac.pm >@@ -160,6 +160,23 @@ sub doPasswordLogin { > return $self; #After a succesfull password login, we are directed to the same page we tried to access. > } > >+sub failPasswordLogin { >+ my ($self, $username, $password) = @_; >+ my $d = $self->getDriver(); >+ $self->debugTakeSessionSnapshot(); >+ >+ my ($submitButton, $useridInput, $passwordInput) = $self->_getPasswordLoginElements(); >+ $useridInput->send_keys($username); >+ $passwordInput->send_keys($password); >+ $submitButton->click(); >+ $self->debugTakeSessionSnapshot(); >+ >+ ok($d->get_title() =~ /Log in to your account/ #Still in the login page >+ , "Opac PasswordLogin failed"); >+ >+ return $self; #After a successful password login, we are directed to the same page we tried to access. >+} >+ > sub doPasswordLogout { > my ($self, $username, $password) = @_; > my $d = $self->getDriver(); >@@ -172,11 +189,10 @@ sub doPasswordLogout { > $self->debugTakeSessionSnapshot(); > > $headerElements = $self->_getHeaderRegionActionElements(); #Take the changed header elements >- my $txt = $headerElements->{login}->get_text(); > ok(($headerElements->{login}->get_text() =~ /Log in/ || > $d->get_title() =~ /Log in to your account/), "Opac Header PasswordLogout succeeded"); >- return t::lib::Page::Opac::OpacMain->rebrandFromPageObject($self); >- ok((), "PasswordLogout succeeded"); >+ >+ ok((), "PasswordLogout succeeded"); > return t::lib::Page::Opac::OpacMain->rebrandFromPageObject($self); > } > >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14536
:
41023
|
41052
|
41057
|
41121
|
41156
|
41254
|
41460
|
41524
|
41525
|
41534
|
41678
|
42060
|
42111
|
42118
|
42136
|
42160
|
42433
|
42435
|
42716
|
44410
|
47254
|
63245