Bug 24801 - selenium/administration_tasks.t failing if too many categories/libraries displayed
Summary: selenium/administration_tasks.t failing if too many categories/libraries disp...
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords: additional_work_needed
Depends on:
Blocks:
 
Reported: 2020-03-04 14:53 UTC by Jonathan Druart
Modified: 2020-03-26 10:08 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 24801: Display all the categories - Selenium fix (1.55 KB, patch)
2020-03-04 14:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24801: Display all the categories - Selenium fix (1.62 KB, patch)
2020-03-04 14:56 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24801: Display all the libraries - Selenium fix (2.69 KB, patch)
2020-03-26 09:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24801: Display all the libraries - Selenium fix (2.76 KB, patch)
2020-03-26 10:08 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2020-03-04 14:53:08 UTC
t/db_dependent/selenium/administration_tasks.t .. 3/3
STRACE: /usr/share/perl5/Try/Tiny.pm:124 in Selenium::Remote::Driver::catch {...}
        /usr/local/share/perl/5.24.1/Selenium/Remote/Driver.pm:353 in Try::Tiny::try
        (eval 1543):1 in Selenium::Remote::Driver::__ANON__
        (eval 1545):2 in Selenium::Remote::Driver::__ANON__
        /usr/local/share/perl/5.24.1/Selenium/Remote/Driver.pm:1330 in Selenium::Remote::Driver::_execute_command
        /usr/local/share/perl/5.24.1/Selenium/Remote/Driver.pm:1330 in (eval)
        /kohadevbox/koha/t/lib/Selenium.pm:174 in Selenium::Remote::Driver::find_element
        /kohadevbox/koha/t/lib/Selenium.pm:166 in t::lib::Selenium::click_when_visible
        t/db_dependent/selenium/administration_tasks.t:189 in t::lib::Selenium::click


SCREENSHOT: https://framapic.org/QV83HpBmIcxN/BAYggoYjgJGi
An element could not be located on the page using the given search parameters: //div[@class="main container-fluid"]//a[contains(@href, "/admin/categories.pl?op=delete_confirm&categorycode=PATRON_CAT")],xpath at/kohadevbox/koha/t/lib/Selenium.pm line 174.
# Looks like your test exited with 255 just after 3.
t/db_dependent/selenium/administration_tasks.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
All 3 subtests passed 

Test Summary Report
-------------------
t/db_dependent/selenium/administration_tasks.t (Wstat: 65280 Tests: 3 Failed: 0)
  Non-zero exit status: 255
Files=1, Tests=3, 61 wallclock secs ( 0.03 usr  0.01 sys +  2.73 cusr  0.29 csys =  3.06 CPU)
Result: FAIL
Comment 1 Jonathan Druart 2020-03-04 14:54:55 UTC
Created attachment 100136 [details] [review]
Bug 24801: Display all the categories - Selenium fix

To make sure we are going to be able to click on the "Delete" button of
our newly created category PATRON_CAT, we are displaying them all.

Test plan:
Create several patron categories that will fill the first page:

use t::lib::TestBuilder;
my $builder = t::lib::TestBuilder->new;
for my $i ( 1..20 ) {
    $builder->build_object({ class => 'Koha::Patron::Categories', value => { description => "cat_$i" } });
}

Execute the selenium tests.
Comment 2 Martin Renvoize 2020-03-04 14:56:36 UTC
Created attachment 100137 [details] [review]
Bug 24801: Display all the categories - Selenium fix

To make sure we are going to be able to click on the "Delete" button of
our newly created category PATRON_CAT, we are displaying them all.

Test plan:
Create several patron categories that will fill the first page:

use t::lib::TestBuilder;
my $builder = t::lib::TestBuilder->new;
for my $i ( 1..20 ) {
    $builder->build_object({ class => 'Koha::Patron::Categories', value => { description => "cat_$i" } });
}

Execute the selenium tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2020-03-04 14:56:59 UTC
A clear and positive improvement.. PQA
Comment 4 Martin Renvoize 2020-03-04 14:57:19 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Jonathan Druart 2020-03-26 09:01:05 UTC
Created attachment 101787 [details] [review]
Bug 24801: Display all the libraries - Selenium fix

Same as for categories.

22:41:28 koha_1       | STRACE:	/usr/share/perl5/Try/Tiny.pm:104 in Selenium::Remote::Driver::catch {...}
22:41:28 koha_1       | 	/usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:353 in Try::Tiny::try
22:41:28 koha_1       | 	(eval 1337):1 in Selenium::Remote::Driver::__ANON__
22:41:28 koha_1       | 	(eval 1339):2 in Selenium::Remote::Driver::__ANON__
22:41:28 koha_1       | 	/usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:1330 in Selenium::Remote::Driver::_execute_command
22:41:28 koha_1       | 	/usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:1330 in (eval)
22:41:28 koha_1       | 	/kohadevbox/koha/t/lib/Selenium.pm:174 in Selenium::Remote::Driver::find_element
22:41:28 koha_1       | 	/kohadevbox/koha/t/lib/Selenium.pm:166 in t::lib::Selenium::click_when_visible
22:41:28 koha_1       | 	t/db_dependent/selenium/administration_tasks.t:128 in t::lib::Selenium::click
22:41:28 koha_1       |
22:41:28 selenium_1   | 14:41:28.273 INFO - Executing: [take screenshot])
22:41:28 selenium_1   | 14:41:28.873 INFO - Done: [take screenshot]
22:41:31 koha_1       |
22:41:31 koha_1       | SCREENSHOT: https://framapic.org/0nvX5dhLHpU1/tAEnENSeLRXB
22:41:31 koha_1       | An element could not be located on the page using the given search parameters: //div[@class="main container-fluid"]//a[contains(@href, "/admin/branches.pl?op=add_form&branchcode=UT_BC")],xpath at /kohadevbox/koha/t/lib/Selenium.pm line 174.

The screenshot was obvious, the UT_BC was not on the first page.
There was a total of 33 libraries at this point, which is not expected,
maybe data not deleted from previous selenium tests.
Comment 6 Martin Renvoize 2020-03-26 10:08:15 UTC
Created attachment 101796 [details] [review]
Bug 24801: Display all the libraries - Selenium fix

Same as for categories.

22:41:28 koha_1       | STRACE:	/usr/share/perl5/Try/Tiny.pm:104 in Selenium::Remote::Driver::catch {...}
22:41:28 koha_1       | 	/usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:353 in Try::Tiny::try
22:41:28 koha_1       | 	(eval 1337):1 in Selenium::Remote::Driver::__ANON__
22:41:28 koha_1       | 	(eval 1339):2 in Selenium::Remote::Driver::__ANON__
22:41:28 koha_1       | 	/usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:1330 in Selenium::Remote::Driver::_execute_command
22:41:28 koha_1       | 	/usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:1330 in (eval)
22:41:28 koha_1       | 	/kohadevbox/koha/t/lib/Selenium.pm:174 in Selenium::Remote::Driver::find_element
22:41:28 koha_1       | 	/kohadevbox/koha/t/lib/Selenium.pm:166 in t::lib::Selenium::click_when_visible
22:41:28 koha_1       | 	t/db_dependent/selenium/administration_tasks.t:128 in t::lib::Selenium::click
22:41:28 koha_1       |
22:41:28 selenium_1   | 14:41:28.273 INFO - Executing: [take screenshot])
22:41:28 selenium_1   | 14:41:28.873 INFO - Done: [take screenshot]
22:41:31 koha_1       |
22:41:31 koha_1       | SCREENSHOT: https://framapic.org/0nvX5dhLHpU1/tAEnENSeLRXB
22:41:31 koha_1       | An element could not be located on the page using the given search parameters: //div[@class="main container-fluid"]//a[contains(@href, "/admin/branches.pl?op=add_form&branchcode=UT_BC")],xpath at /kohadevbox/koha/t/lib/Selenium.pm line 174.

The screenshot was obvious, the UT_BC was not on the first page.
There was a total of 33 libraries at this point, which is not expected,
maybe data not deleted from previous selenium tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>