Bugzilla – Attachment 76415 Details for
Bug 20921
Expose borrowernumber and branch when user is logged in to OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20921: Add selenium tests for .loggedinusername
Bug-20921-Add-selenium-tests-for-loggedinusername.patch (text/plain), 2.73 KB, created by
Jonathan Druart
on 2018-06-25 19:57:22 UTC
(
hide
)
Description:
Bug 20921: Add selenium tests for .loggedinusername
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-06-25 19:57:22 UTC
Size:
2.73 KB
patch
obsolete
>From 87a919b3c155e05af10c4ec6aa185b2e920e88dd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 25 Jun 2018 16:48:59 -0300 >Subject: [PATCH] Bug 20921: Add selenium tests for .loggedinusername > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/selenium/regressions.t | 61 +++++++++++++++++++++++++++++++++++ > 1 file changed, 61 insertions(+) > create mode 100644 t/db_dependent/selenium/regressions.t > >diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t >new file mode 100644 >index 0000000000..cdb49ff51f >--- /dev/null >+++ b/t/db_dependent/selenium/regressions.t >@@ -0,0 +1,61 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use C4::Context; >+ >+use Test::More tests => 1; >+ >+use Koha::AuthUtils; >+use t::lib::Selenium; >+use t::lib::TestBuilder; >+ >+eval { require Selenium::Remote::Driver; }; >+skip "Selenium::Remote::Driver is needed for selenium tests.", 1 if $@; >+ >+my $s = t::lib::Selenium->new; >+ >+my $driver = $s->driver; >+my $base_url = $s->base_url; >+my $builder = t::lib::TestBuilder->new; >+ >+our @cleanup; >+subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { >+ plan tests => 2; >+ >+ my $patron = $builder->build_object( >+ { class => 'Koha::Patrons', value => { flags => 1 } } ); >+ my $password = Koha::AuthUtils::generate_password(); >+ my $digest = Koha::AuthUtils::hash_password($password); >+ $patron->update_password( $patron->userid, $digest ); >+ $s->opac_auth( $patron->userid, $password ); >+ my $elt = $driver->find_element('//span[@class="loggedinusername"]'); >+ is( $elt->get_attribute('data-branchcode'), $patron->library->branchcode, >+ "Since bug 20921 span.loggedinusername should contain data-branchcode" >+ ); >+ is( $elt->get_attribute('data-borrowernumber'), $patron->borrowernumber, >+"Since bug 20921 span.loggedinusername should contain data-borrowernumber" >+ ); >+ push @cleanup, $patron; >+ push @cleanup, $patron->category; >+ push @cleanup, $patron->library; >+}; >+ >+END { >+ $_->delete for @cleanup; >+}; >-- >2.11.0
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 20921
:
76005
|
76200
|
76310
|
76413
|
76414
| 76415