Bugzilla – Attachment 124685 Details for
Bug 28929
No filtering on borrowers.flags on member entry pages (OPAC, self registration, staff interface)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28929: Add selenium tests
Bug-28929-Add-selenium-tests.patch (text/plain), 3.25 KB, created by
Jonathan Druart
on 2021-09-09 08:08:35 UTC
(
hide
)
Description:
Bug 28929: Add selenium tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-09-09 08:08:35 UTC
Size:
3.25 KB
patch
obsolete
>From 85c8b1df5532d600427ae18715d7ef5afefd1cc9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 31 Aug 2021 17:12:22 +0200 >Subject: [PATCH] Bug 28929: Add selenium tests > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Bug 28929: (follow-up) Add exec flag to tests > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/selenium/self_registration.t | 71 +++++++++++++++++++++ > 1 file changed, 71 insertions(+) > create mode 100755 t/db_dependent/selenium/self_registration.t > >diff --git a/t/db_dependent/selenium/self_registration.t b/t/db_dependent/selenium/self_registration.t >new file mode 100755 >index 00000000000..737dd691c88 >--- /dev/null >+++ b/t/db_dependent/selenium/self_registration.t >@@ -0,0 +1,71 @@ >+#!/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 utf8; >+ >+use C4::Context; >+ >+use Test::More tests => 1; >+use Test::MockModule; >+ >+use C4::Context; >+use Koha::AuthUtils; >+use t::lib::Selenium; >+use t::lib::TestBuilder; >+use t::lib::Mocks; >+ >+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 $opac_base_url = $s->opac_base_url; >+my $builder = t::lib::TestBuilder->new; >+ >+my $PatronSelfRegistration_value = C4::Context->preference('PatronSelfRegistration'); >+C4::Context->set_preference('PatronSelfRegistration', '1'); >+ >+our @cleanup; >+ >+subtest 'Set flags' => sub { >+ plan tests => 2; >+ >+ $driver->get($opac_base_url . 'opac-memberentry.pl'); >+ like( $driver->get_title(), qr(Register a new account), ); >+ >+ $driver->find_element('//*[@id="borrower_surname"]')->send_keys("a surname"); >+ $driver->find_element('//*[@id="borrower_firstname"]')->send_keys("a firstname"); >+ $driver->find_element('//*[@id="borrower_initials"]')->send_keys("1"); >+ $driver->execute_script(q{document.querySelector("#borrower_initials").setAttribute("name", "borrower_flags");}); >+ my $captcha = $driver->find_element('//*[@id="captcha"]/following-sibling::span/strong')->get_text(); >+ $driver->find_element('//*[@id="captcha"]')->send_keys($captcha); >+ $s->submit_form; >+ >+ my $patron = Koha::Patrons->search({ surname => "a surname" })->next; >+ is( $patron->flags, undef, 'flags must be undef even if user tried to pass it' ); >+ push @cleanup, $patron; >+}; >+ >+ >+$driver->quit(); >+ >+END { >+ C4::Context->set_preference('PatronSelfRegistration', $PatronSelfRegistration_value); >+ $_->delete for @cleanup; >+}; >-- >2.25.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 28929
:
124308
|
124310
|
124315
|
124316
|
124317
|
124323
|
124325
|
124364
|
124365
|
124366
|
124405
|
124406
|
124407
|
124683
|
124684
| 124685