[Koha-bugs] [Bug 35506] selenium/regressions.t is failing randomly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 5 17:45:50 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35506

--- Comment #22 from Victor Grousset/tuxayo <victor at tuxayo.net> ---
(In reply to Jonathan Druart from comment #21)
> window._pageFullyReady
> 
> I don't understand how this is useful. Selenium should wait for the page to
> be loaded before starting the tests.

No, it's not about the page to be loaded. It's about $(document).ready() to
have finished all it's content. The event Selenium waits for is the same as the
one $(document).ready() waits for IIUC.

So they both start at the same time and from time to time, Selenium reaches the
"Show checkouts" button before $(document).ready() {[...]} has reached the
point where it give the button it's callback. So Selenium click on an inactive
button and nothing happens. That's what I understood from the screenshots
showing the button looking like blocked in the pressed position and Koha no
doing the expected action. And it seems confirmed by the usage of
window._pageFullyReady preventing the issue.

> If it's because of async statements, then this won't help.

I don't know if the following is async, whether attaching the callback is
async. But by the time it reaches setting window._pageFullyReady. Then the
button is functional and all works as expected.

    $('#issues-table-load-now-button').click(function(){
[....]
    });

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list