Bugzilla – Attachment 82001 Details for
Bug 21775
Lack of tests for audio alerts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21775: Add selenium tests for audio alerts
Bug-21775-Add-selenium-tests-for-audio-alerts.patch (text/plain), 2.78 KB, created by
Jonathan Druart
on 2018-11-06 18:19:03 UTC
(
hide
)
Description:
Bug 21775: Add selenium tests for audio alerts
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-11-06 18:19:03 UTC
Size:
2.78 KB
patch
obsolete
>From 95c50e04ea9780f2a53691dd36e4abe32896a809 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 6 Nov 2018 15:12:32 -0300 >Subject: [PATCH] Bug 21775: Add selenium tests for audio alerts > >To prevent future regressions >--- > t/db_dependent/selenium/regressions.t | 29 +++++++++++++++++++++++++---- > 1 file changed, 25 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t >index 014b516209..99c66fc9a6 100644 >--- a/t/db_dependent/selenium/regressions.t >+++ b/t/db_dependent/selenium/regressions.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use C4::Context; > >-use Test::More tests => 2; >+use Test::More tests => 3; > > use C4::Context; > use Koha::AuthUtils; >@@ -33,12 +33,16 @@ my $s = t::lib::Selenium->new; > > my $driver = $s->driver; > my $opac_base_url = $s->opac_base_url; >+my $base_url = $s->base_url; > my $builder = t::lib::TestBuilder->new; > > # It seems that we do not have enough records indexed with ES > my $SearchEngine_value = C4::Context->preference('SearchEngine'); > C4::Context->set_preference('SearchEngine', 'Zebra'); > >+my $AudioAlerts_value = C4::Context->preference('AudioAlerts'); >+C4::Context->set_preference('AudioAlerts', '1'); >+ > our @cleanup; > subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { > plan tests => 2; >@@ -55,9 +59,7 @@ subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { > 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; >+ push @cleanup, $patron, $patron->category, $patron->library; > }; > > subtest 'OPAC - Remove from cart' => sub { >@@ -93,7 +95,26 @@ subtest 'OPAC - Remove from cart' => sub { > 2, '1 element should have been removed from the cart' ); > }; > >+subtest 'Play sound on the circulation page' => sub { >+ plan tests => 1; >+ >+ my $builder = t::lib::TestBuilder->new; >+ my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 0 }}); >+ >+ my $mainpage = $s->base_url . q|mainpage.pl|; >+ $driver->get($mainpage); >+ like( $driver->get_title(), qr(Log in to Koha), ); >+ $s->auth; >+ >+ $driver->get( $base_url . "/circ/circulation.pl?borrowernumber=" . $patron->borrowernumber ); >+ >+ my $audio_node = $driver->find_element('//span[@id="audio-alert"]/audio[@src="/intranet-tmpl/prog/sound/beep.ogg"]'); >+ >+ push @cleanup, $patron, $patron->category, $patron->library; >+}; >+ > END { > C4::Context->preference('SearchEngine', $SearchEngine_value); >+ C4::Context->preference('AudioAlerts', $AudioAlerts_value); > $_->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 21775
:
82001
|
82002
|
82164
|
82249