Koha-clms/t/lib
Jonathan Druart 527b2b634f
Bug 29458: Fix selenium test
The authentication.t selenium tests (and a couple of others) were
failing with:
Error while executing command: element not interactable: Element <input class="btn btn-primary" type="submit"> could not be scrolled into view at /usr/local/share/perl/5.32.1/Selenium/Remote/Driver.pm line 411. at /usr/local/share/perl/5.32.1/Selenium/Remote/Driver.pm line 356.

We changed the other of the form, and t::lib::Selenium::submit_form was
not getting the correct (first) form. The one from the auth modal was
retrieved and submit button was clicked. Selenium raised an error as it
is not displayed.
The ->is_displayed selenium method does not work, as per the doc
"""
Note: This does *not* tell you an element's 'visibility' property; as it still takes up space in the DOM and is therefore considered 'displayed'.
"""
https://metacpan.org/pod/Selenium::Remote::WebElement#is_displayed

"The internet" is saying we should be able to use the following in our
xpath expression: not(ancestor::div[contains(@style,'display:none')]
but it actually only works if the display:none rule is defined on the
node (not from .css). Which does not work for us.

The only solution I found is to check for the size of the element, which
is (0,0) if not effectively displayed.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5520b8fb84)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 17:45:46 +01:00
..
Koha/BackgroundJob Bug 29273: Remove warnings from plugin tests 2021-11-15 12:38:39 +01:00
Mocks Bug 29368: Correctly mock Zebra index from tests 2021-10-29 15:45:53 +02:00
QA Bug 31883: Filter trim causes false warnings 2022-12-16 14:30:55 +01:00
bad_plugins/Koha/Plugin Bug 29273: Remove warnings from plugin tests 2021-11-15 12:38:39 +01:00
plugins/Koha/Plugin Bug 31684: Set Koha::Plugin::Test version to 'v1.01' 2022-12-16 14:33:33 +01:00
Bootstrap.pm Bug 19821: Require database_test != database 2021-10-25 11:27:40 +02:00
Dates.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Mocks.pm Bug 17600: Remove wrong C4::Context imports 2021-09-20 14:44:27 +02:00
Selenium.pm Bug 29458: Fix selenium test 2023-01-13 17:45:46 +01:00
TestBuilder.pm Bug 31145: Supply defaults for vendors and funds 2022-08-26 10:08:45 +02:00