Bugzilla – Attachment 143822 Details for
Bug 31908
New login fails while having cookie from previous session
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31908: Add selenium tests
Bug-31908-Add-selenium-tests.patch (text/plain), 2.50 KB, created by
Marcel de Rooy
on 2022-11-14 12:20:59 UTC
(
hide
)
Description:
Bug 31908: Add selenium tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-11-14 12:20:59 UTC
Size:
2.50 KB
patch
obsolete
>From c80cd93024ffd196e4aee2acdb04919fb75d47e6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 11 Nov 2022 13:08:53 +0100 >Subject: [PATCH] Bug 31908: Add selenium tests >Content-Type: text/plain; charset=utf-8 > >--- > t/db_dependent/selenium/authentication.t | 28 ++++++++++++++++++++++-- > 1 file changed, 26 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/selenium/authentication.t b/t/db_dependent/selenium/authentication.t >index 25dc8ed324..dce1cbd8df 100755 >--- a/t/db_dependent/selenium/authentication.t >+++ b/t/db_dependent/selenium/authentication.t >@@ -23,7 +23,7 @@ > #Note: If you are testing this on kohadevbox with selenium installed in kohadevbox then you need to set the staffClientBaseURL to localhost:8080 and the OPACBaseURL to localhost:80 > > use Modern::Perl; >-use Test::More tests => 2; >+use Test::More tests => 3; > > use C4::Context; > use Koha::AuthUtils; >@@ -35,7 +35,7 @@ my @data_to_cleanup; > > SKIP: { > eval { require Selenium::Remote::Driver; }; >- skip "Selenium::Remote::Driver is needed for selenium tests.", 2 if $@; >+ skip "Selenium::Remote::Driver is needed for selenium tests.", 3 if $@; > > my $builder = t::lib::TestBuilder->new; > my $s = t::lib::Selenium->new; >@@ -276,6 +276,30 @@ SKIP: { > push @data_to_cleanup, $patron, $patron->category, $patron->library; > }; > >+ subtest 'Regressions' => sub { >+ >+ plan tests => 2; >+ >+ my $mainpage = $s->base_url . q|mainpage.pl|; >+ >+ my $patron_1 = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 1 }}); >+ my $patron_2 = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 0 }}); >+ my $password = 'password'; >+ t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); >+ $patron_1->set_password({ password => $password }); >+ $patron_2->set_password({ password => $password }); >+ >+ $driver->get($mainpage . q|?logout.x=1|); >+ $s->auth( $patron_2->userid, $password ); >+ like( $driver->get_title, qr(Access denied), 'Patron without permissions should not be able to login' ); >+ >+ $s->auth( $patron_1->userid, $password ); >+ like( $driver->get_title(), qr(Koha staff interface), 'Patron with permissions should be able to login' ); >+ >+ push @data_to_cleanup, $patron_1, $patron_1->category, $patron_1->library; >+ push @data_to_cleanup, $patron_2, $patron_2->category, $patron_2->library; >+ }; >+ > $driver->quit(); > }; > >-- >2.30.2
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 31908
:
142361
|
143392
|
143491
|
143786
|
143819
|
143820
|
143821
|
143822
|
143884
|
143885
|
143886
|
143887
|
145092
|
145093
|
145250
|
145251
|
145252