Lines 29-34
use t::lib::Page::Opac::OpacMain;
Link Here
|
29 |
|
29 |
|
30 |
use t::lib::TestObjects::BorrowerFactory; |
30 |
use t::lib::TestObjects::BorrowerFactory; |
31 |
|
31 |
|
|
|
32 |
##Enable debug mode for PageObject tests. |
33 |
#$ENV{KOHA_PAGEOBJECT_DEBUG} = 1; |
34 |
|
32 |
##Setting up the test context |
35 |
##Setting up the test context |
33 |
my $testContext = {}; |
36 |
my $testContext = {}; |
34 |
|
37 |
|
Lines 59-70
$permissionManager->grantPermission($borrowers->{'maxi_admin'}, 'superlibrarian'
Link Here
|
59 |
eval { #run in a eval-block so we don't die without tearing down the test context |
62 |
eval { #run in a eval-block so we don't die without tearing down the test context |
60 |
|
63 |
|
61 |
my $mainpage = t::lib::Page::Mainpage->new(); |
64 |
my $mainpage = t::lib::Page::Mainpage->new(); |
|
|
65 |
testBadPasswordLogin($mainpage); |
62 |
testPasswordLoginLogout($mainpage); |
66 |
testPasswordLoginLogout($mainpage); |
63 |
testSuperuserPasswordLoginLogout($mainpage); |
67 |
testSuperuserPasswordLoginLogout($mainpage); |
64 |
testSuperlibrarianPasswordLoginLogout($mainpage); |
68 |
testSuperlibrarianPasswordLoginLogout($mainpage); |
65 |
$mainpage->quit(); |
69 |
$mainpage->quit(); |
66 |
|
70 |
|
67 |
my $opacmain = t::lib::Page::Opac::OpacMain->new(); |
71 |
my $opacmain = t::lib::Page::Opac::OpacMain->new(); |
|
|
72 |
testBadPasswordLogin($opacmain); |
68 |
testOpacPasswordLoginLogout($opacmain); |
73 |
testOpacPasswordLoginLogout($opacmain); |
69 |
testSuperuserPasswordLoginLogout($opacmain); |
74 |
testSuperuserPasswordLoginLogout($opacmain); |
70 |
testOpacSuperlibrarianPasswordLoginLogout($opacmain); |
75 |
testOpacSuperlibrarianPasswordLoginLogout($opacmain); |
Lines 88-93
sub tearDown {
Link Here
|
88 |
### STARTING TEST IMPLEMENTATIONS ### |
93 |
### STARTING TEST IMPLEMENTATIONS ### |
89 |
###################################################### |
94 |
###################################################### |
90 |
|
95 |
|
|
|
96 |
sub testBadPasswordLogin { |
97 |
my ($mainpage) = @_; |
98 |
$mainpage->isPasswordLoginAvailable()->failPasswordLogin($borrowers->{'1A01'}->userid(), 'a truly bad password') |
99 |
->refresh() #Refresh is important in bringing out certain bugs with cookies and misset Userid. |
100 |
->isPasswordLoginAvailable(); |
101 |
} |
91 |
sub testPasswordLoginLogout { |
102 |
sub testPasswordLoginLogout { |
92 |
my ($mainpage) = @_; |
103 |
my ($mainpage) = @_; |
93 |
$mainpage->isPasswordLoginAvailable()->doPasswordLogin($borrowers->{'1A01'}->userid(), $password) |
104 |
$mainpage->isPasswordLoginAvailable()->doPasswordLogin($borrowers->{'1A01'}->userid(), $password) |
94 |
- |
|
|