Bugzilla – Attachment 161414 Details for
Bug 35329
Move patron searches to a modal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35329: Add POD + tidy Selenium.pm
Bug-35329-Add-POD--tidy-Seleniumpm.patch (text/plain), 3.50 KB, created by
Martin Renvoize (ashimema)
on 2024-01-25 14:04:24 UTC
(
hide
)
Description:
Bug 35329: Add POD + tidy Selenium.pm
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-25 14:04:24 UTC
Size:
3.50 KB
patch
obsolete
>From a151f47bf21d74c49f98612d9f4d2b898cdbafa1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 12 Jan 2024 13:27:50 +0100 >Subject: [PATCH] Bug 35329: Add POD + tidy Selenium.pm > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/lib/Selenium.pm | 49 ++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 40 insertions(+), 9 deletions(-) > >diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm >index d68b8af443c..98f6577d169 100644 >--- a/t/lib/Selenium.pm >+++ b/t/lib/Selenium.pm >@@ -114,17 +114,18 @@ sub opac_auth { > sub fill_form { > my ( $self, $values ) = @_; > while ( my ( $id, $value ) = each %$values ) { >- my $attr = 'id'; >+ my $attr = 'id'; > my $attr_value = $id; > if ( $id =~ m{=} ) { >- ($attr, $attr_value) = split '=', $id; >+ ( $attr, $attr_value ) = split '=', $id; > } >- my $element = $self->driver->find_element(sprintf '//*[@%s="%s"]', $attr, $attr_value); >- my $tag = $element->get_tag_name(); >+ my $element = $self->driver->find_element( sprintf '//*[@%s="%s"]', $attr, $attr_value ); >+ my $tag = $element->get_tag_name(); > if ( $tag eq 'input' ) { >- $self->driver->find_element(sprintf '//input[@%s="%s"]', $attr, $attr_value)->send_keys($value); >+ $self->driver->find_element( sprintf '//input[@%s="%s"]', $attr, $attr_value )->send_keys($value); > } elsif ( $tag eq 'select' ) { >- $self->driver->find_element(sprintf '//select[@%s="%s"]//option[@value="%s"]', $attr, $attr_value, $value)->click; >+ $self->driver->find_element( sprintf '//select[@%s="%s"]//option[@value="%s"]', $attr, $attr_value, $value ) >+ ->click; > } > } > } >@@ -201,12 +202,12 @@ sub wait_for_element_visible { > sub wait_for_element_hidden { > my ( $self, $xpath_selector ) = @_; > >- my ($hidden, $elt); >+ my ( $hidden, $elt ); > $self->remove_error_handler; > my $max_retries = $self->max_retries; > my $i; > while ( not $hidden ) { >- $elt = eval {$self->driver->find_element($xpath_selector) }; >+ $elt = eval { $self->driver->find_element($xpath_selector) }; > $hidden = $elt || !$elt->is_displayed; > $self->driver->pause(1000) unless $hidden; > >@@ -351,13 +352,43 @@ when we use automation test using Selenium > > =head2 click > >- $s->click >+ $s->click($xpath_selector); > > This is a bit dirty for now but will evolve depending on the needs > 3 parameters possible but only the following 2 forms are used: > $s->click({ href => '/module/script.pl?foo=bar', main => 'doc3' }); # Sometimes we have doc or doc3. To make sure we are not going to hit a link in the header > $s->click({ id => 'element_id }); > >+=head2 wait_for_element_visible >+ >+ $s->wait_for_element_visible($xpath_selector) >+ >+ Wait 10s for an element to be visible >+ >+=head2 wait_for_element_hidden >+ >+ $s->wait_for_element_hidden($xpath_selector) >+ >+ Wait 10s for an element to be hidden >+ >+=head2 wait_for_ajax >+ >+ $s->wait_for_ajax; >+ >+ Wait 10s for all the current AJAX requests to be received. >+ >+=head2 get_next_alert_text >+ >+ $s->get_next_alert_text; >+ >+ Retrieve the next alert text. >+ >+=head2 show_all_entries >+ >+ $s->show_all_entries($xpath_selector); >+ >+ Select the "All" entries of the DataTables present in the selector. >+ > =head2 click_when_visible > > $c->click_when_visible >-- >2.43.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 35329
:
160698
|
160699
|
160700
|
160701
|
160702
|
160703
|
160704
|
160705
|
160706
|
160728
|
160729
|
160733
|
160734
|
160735
|
160736
|
160737
|
160738
|
160739
|
160740
|
160741
|
160742
|
160743
|
160759
|
160760
|
160761
|
160762
|
160763
|
160768
|
160769
|
160770
|
160771
|
160773
|
160774
|
160940
|
160941
|
160943
|
160944
|
160945
|
160946
|
160947
|
160948
|
160949
|
160950
|
160951
|
160952
|
160953
|
160954
|
160955
|
160956
|
160957
|
160958
|
160959
|
161165
|
161166
|
161183
|
161184
|
161185
|
161186
|
161187
|
161188
|
161189
|
161190
|
161191
|
161192
|
161193
|
161194
|
161195
|
161196
|
161197
|
161198
|
161199
|
161259
|
161260
|
161274
|
161275
|
161276
|
161277
|
161278
|
161279
|
161280
|
161281
|
161282
|
161283
|
161284
|
161285
|
161286
|
161287
|
161288
|
161289
|
161290
|
161291
|
161292
|
161293
|
161294
|
161295
|
161398
|
161399
|
161400
|
161401
|
161402
|
161403
|
161404
|
161405
|
161406
|
161407
|
161408
|
161409
|
161410
|
161411
|
161412
|
161413
|
161414
|
161415
|
161416
|
161417
|
162436
|
162437
|
162438
|
162439
|
162440
|
162441
|
162442
|
162443
|
162444
|
162445
|
162446
|
162447
|
162448
|
162449
|
162450
|
162451
|
162452
|
162453
|
162454
|
162455
|
162456
|
162457
|
162670
|
162671
|
162713
|
162714