Bugzilla – Attachment 132739 Details for
Bug 30063
Make the main patron search use the /patrons REST API route
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30063: Fix selenium tests
Bug-30063-Fix-selenium-tests.patch (text/plain), 2.94 KB, created by
Jonathan Druart
on 2022-03-31 12:47:17 UTC
(
hide
)
Description:
Bug 30063: Fix selenium tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-03-31 12:47:17 UTC
Size:
2.94 KB
patch
obsolete
>From 7bb0accd33ddee781158d976257a4fa09d147644 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 15 Feb 2022 12:28:23 +0100 >Subject: [PATCH] Bug 30063: Fix selenium tests >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Séverine Queune <severine.queune@bulac.fr> >--- > t/db_dependent/selenium/patrons_search.t | 5 +++-- > t/lib/Selenium.pm | 19 +++++++++++++++++++ > 2 files changed, 22 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t >index 0d338298d9b..dc09d70113e 100755 >--- a/t/db_dependent/selenium/patrons_search.t >+++ b/t/db_dependent/selenium/patrons_search.t >@@ -102,10 +102,11 @@ subtest 'Search patrons' => sub { > is( scalar @adv_options, 12, 'Invalid option not added when DefaultPatronSearchFields is populated with an invalid field'); > is( scalar @filter_options, 12, 'Invalid filter option not added when DefaultPatronSearchFields is populated with an invalid field'); > C4::Context->set_preference('DefaultPatronSearchFields',""); >- $s->fill_form( { searchmember_filter => 'test_patron' } ); >+ $s->fill_form( { search_patron_filter => 'test_patron' } ); > $s->submit_form; > my $first_patron = $patrons[0]; > >+ $s->wait_for_datatable_visible('//table[@id="memberresultst"]'); > my @td = $driver->find_elements('//table[@id="memberresultst"]/tbody/tr/td'); > like ($td[2]->get_text, qr[\Q$firstname\E], > 'Column "Name" should be the 3rd and contain the firstname correctly filtered' >@@ -116,7 +117,7 @@ subtest 'Search patrons' => sub { > like ($td[2]->get_text, qr[\Q$email\E], > 'Column "Name" should be the 3rd and contain the email address correctly filtered' > ); >- is( $td[5]->get_text, $branchname, >+ is( $td[4]->get_text, $branchname, > 'Column "Library" should be the 6th and contain the html tags - they have been html filtered' > ); > is( $td[9]->get_text, $borrowernotes_displayed, >diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm >index 6d9afacdce5..1b24e669759 100644 >--- a/t/lib/Selenium.pm >+++ b/t/lib/Selenium.pm >@@ -193,6 +193,25 @@ sub wait_for_element_visible { > return $elt; > } > >+sub wait_for_datatable_visible { >+ my ( $self, $xpath_selector ) = @_; >+ >+ my ($visible, $elt); >+ $self->remove_error_handler; >+ my $max_retries = $self->max_retries; >+ my $i; >+ while ( not $visible ) { >+ $elt = eval {$self->driver->find_element($xpath_selector . '//td[class="dataTables_empty"]')}; >+ $visible = $elt && $elt->get_text ne 'No data available in table'; >+ $self->driver->pause(1000) unless $visible; >+ >+ die "Cannot wait more for element '$xpath_selector' to be visible" >+ if $max_retries <= ++$i >+ } >+ $self->add_error_handler; >+ return $elt; >+} >+ > sub show_all_entries { > my ( $self, $xpath_selector ) = @_; > >-- >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 30063
:
130608
|
130609
|
130610
|
130611
|
130612
|
130613
|
130614
|
130615
|
132387
|
132552
|
132731
|
132732
|
132733
|
132734
|
132735
|
132736
|
132737
|
132738
|
132739
|
132740
|
132741
|
132742
|
132743
|
132744
|
132745
|
132746
|
132747
|
132748
|
132749
|
132759
|
132760
|
132761
|
132762
|
132763
|
132764
|
132765
|
132766
|
132767
|
132768
|
132769
|
132770
|
132771
|
132772
|
132773
|
132774
|
132775
|
132776
|
132777
|
132958