From 178026f3390ffae38445449477a39211cead3d04 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 27 Jan 2021 11:35:35 +0100 Subject: [PATCH] Bug 27029: Add a selenium regression test Signed-off-by: Jonathan Druart (cherry picked from commit 03dea5f51e3859090f563f72475cffa1da9c7645) Signed-off-by: Fridolin Somers --- t/db_dependent/selenium/regressions.t | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t index 141bd45f2d..df6f8b86bc 100755 --- 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 => 5; +use Test::More tests => 6; use Test::MockModule; use C4::Context; @@ -73,6 +73,23 @@ subtest 'OPAC - borrowernumber, branchcode and categorycode as html attributes' push @cleanup, $patron, $patron->category, $patron->library; }; +subtest 'OPAC - Bibliographic record detail page must contain the data-biblionumber' => sub { + plan tests => 1; + + my $builder = t::lib::TestBuilder->new; + + my ( $biblionumber, $biblioitemnumber ) = add_biblio(); + my $biblio = Koha::Biblios->find($biblionumber); + + $driver->get( $opac_base_url . "opac-detail.pl?biblionumber=$biblionumber" ); + + my $elt = $driver->find_element('//div[@id="catalogue_detail_biblio"]'); + is( $elt->get_attribute( 'data-biblionumber', 1 ), + $biblionumber, "#catalogue_detail_biblio contains data-biblionumber" ); + + push @cleanup, $biblio; + }; + subtest 'OPAC - Remove from cart' => sub { plan tests => 4; -- 2.39.5