Main Koha release repository https://koha-community.org
Find a file
Jonathan Druart 5aa213e210 Bug 35598: Fix selenium/authentication_2fa.t random failure
Jenkins is failing with
koha_1       | STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
koha_1       | 	(eval 582):1 in Selenium::Remote::Driver::__ANON__
koha_1       | 	(eval 584):2 in Selenium::Remote::Driver::__ANON__
koha_1       | 	(eval 556):17 in Selenium::Remote::Driver::_execute_command
koha_1       | 	/usr/share/perl5/Selenium/Remote/WebElement.pm:125 in Selenium::Remote::WebElement::_execute_command
koha_1       | 	t/db_dependent/selenium/authentication_2fa.t:276 in Selenium::Remote::WebElement::send_keys
koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in main::__ANON__
koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in (eval)
koha_1       | 	/usr/share/perl/5.32/Test/More.pm:809 in Test::Builder::subtest
koha_1       | 	t/db_dependent/selenium/authentication_2fa.t:294 in Test::More::subtest
koha_1       |
selenium_1   | 1702911648831	Marionette	INFO	Stopped listening on port 41385
selenium_1   | JavaScript error: resource:///modules/Interactions.jsm, line 230: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
selenium_1   | 15:00:49.452 INFO [ActiveSessions$1.onStop] - Removing session c3461b22-7a80-4b56-b177-653a53cc2651 (org.openqa.selenium.firefox.GeckoDriverService)
koha_1       |     # Looks like you planned 7 tests but ran 3.
koha_1       |
koha_1       | #   Failed test 'Enforce 2FA setup on first login'
koha_1       | #   at t/db_dependent/selenium/authentication_2fa.t line 294.
koha_1       | Error while executing command: element not interactable: Element <input id="pin_code" name="pin_code" type="text"> is not reachable by keyboard at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.

The error is: "Element <input id="pin_code" name="pin_code" type="text"> is not reachable by keyboard"

A guess is that the input is either 1. outside of the viewport, or 2. not
displayed yet.

1. We are hidding #registration-form then show it when we retrieved the
   info (after POST /api/v1/auth/two-factor/registration)
2. Couldn't there be a race condition?
In auth.tt
284                     success: function (data) {
292                         $("#registration-form").show();
And in the selenium test:
$s->wait_for_ajax; # There is an ajax request to populate the qr_code and the secret
Not sure this wait_for_ajax is waiting for the end of success, I don't
think so.

This patch is supposed to fix both theories.

Test plan:
0. Do not apply the patch
1. Edit auth.tt and sleep 1 second before showing the form:
290                         const sleep = ms => new Promise(r => setTimeout(r, ms));
291                         await sleep(1000);
292                         $("#registration-form").show();

You will also need to replace the following line (284):
  success: function (data) {
with
  success: async function (data) {

2. prove t/db_dependent/selenium/authentication_2fa.t
=> "is not reachable by keyboard" error!

3. Apply the patch, keep the sleep

4. prove t/db_dependent/selenium/authentication_2fa.t
=> Tests are passing

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit (tcohen): Tidied a bit to clear complaints
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3270d32191)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-01-15 14:28:55 +01:00
acqui Bug 34708: Add ability to modify orderline to increase quantity 2023-11-09 10:15:05 -03:00
admin Bug 35460: Fix add and edit of hold rules in circulation rules table 2023-12-11 21:44:27 -10:00
api Bug 35658: Fix misaligned collectionFormat in patron_holds.yaml 2024-01-08 15:05:50 +01:00
authorities Bug 33406: (QA follow-up) Adjust tests and tidy 2023-09-15 15:50:43 -03:00
basket Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
bin
bookings Bug 35574: Bookings tab from biblio details should only require manage_bookings permission 2024-01-03 15:48:28 +01:00
C4 Bug 35587: Do not trigger transfer if lost item returned and BlockReturnOfLostItems enabled 2024-01-08 15:35:58 +01:00
catalogue Bug 35618: Remove deprecated parameter "type" from showelastic.pl page 2024-01-03 17:25:29 +01:00
cataloguing Bug 35414: Silence warn related to number_of_copies 2023-12-11 21:37:28 -10:00
circ Bug 35216: Rename error to issuingimpossible 2024-01-03 15:54:32 +01:00
clubs Bug 25079: Show club enrollment question answers in staff client 2023-06-23 11:00:54 -03:00
course_reserves
debian Bug 35174: update control files for koha-l10n dependency package 2023-11-16 11:31:55 +01:00
docs 23.11.00: Update history.txt 2023-11-30 14:58:48 -03:00
erm
errors
etc Bug 35455: Remove = in ICU for indexing/searching 2024-01-03 16:33:05 +01:00
ill Bug 30719: ILL Batches 2023-10-17 14:45:15 -03:00
installer Bug 35698: (bug 32162 follow-up) fix bug number in db rev 2024-01-08 15:06:27 +01:00
Koha Bug 35070: Fix get_enabled_plugins when database is not created yet 2024-01-08 15:18:37 +01:00
koha-tmpl Bug 35696: Fix regression caused by bug 33167 2024-01-08 15:35:00 +01:00
labels Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
lib/CGI/Session/Serialize
members Bug 30287: Conditionally render notice preview 2024-01-03 16:03:42 +01:00
misc Fix release notes for 23.11.01 2024-01-02 11:34:43 +01:00
offline_circ Bug 34529: Offline circulation should be able to accept userid as well as cardnumber 2023-11-06 11:34:44 -03:00
opac Bug 35496: (QA follow-up): tidy up code 2024-01-03 15:10:21 +01:00
patron_lists Bug 34977: (QA follow-up) Tidy code 2023-11-08 11:41:33 -03:00
patroncards
plugins Bug 25672: Fix double output_html_with_http_headers 2023-10-31 11:02:45 -03:00
pos Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
preservation Bug 34030: Add a "print slips" action links to print in batch 2023-10-23 11:33:55 -03:00
recalls Bug 34013: Recalls awaiting pickup doesn't show count on each tab 2023-06-23 10:01:04 -03:00
reports Bug 34456: (QA follow-up) perltidy code 2023-11-01 17:23:18 -03:00
reserve Bug 34519: Add a template plugin for fetch searchable patron attributes 2023-11-08 17:52:37 -03:00
reviews
rotating_collections
serials Bug 28012: Use definedness test instead of bool when checking whether to null fields 2024-01-03 17:27:11 +01:00
services
skel Bug 11078: Add locking to rebuild_zebra 2014-02-28 22:21:41 +00:00
suggestion Bug 35276: Remove authentication params from suggestion hash 2023-11-14 10:32:38 -03:00
svc Bug 35181: Don't pass undef to header 2023-11-06 08:42:46 -03:00
t Bug 35598: Fix selenium/authentication_2fa.t random failure 2024-01-15 14:28:55 +01:00
tags
tools Bug 35291: (QA follow-up) Tidying script for QA test tools 2023-11-24 16:43:25 -03:00
virtualshelves Bug 35547: Show public "staff only" lists in addbybiblionumber.pl 2024-01-03 16:36:51 +01:00
xt Bug 34911: Test files from HEAD instead of 'master' 2023-10-04 09:15:35 -04:00
.editorconfig
.eslintrc.json
.gitignore Bug 35174: Add misc/translator/po to .gitignore 2023-11-16 08:56:36 +01:00
.htaccess
.mailmap 23.11.00: Update mailmap 2023-11-30 14:58:47 -03:00
.perlcriticrc
.perltidyrc Bug 30002: Adjust perltidy 2023-06-08 08:32:42 -03:00
.proverc.dist
.stylelintrc.json
about.pl Bug 35174: Add a warning to the about page 2023-11-16 08:56:36 +01:00
app.psgi
build-resources.PL
changelanguage.pl
cpanfile Bug 34064: Add SQL::Translator dependency to cpanfile 2023-10-10 10:54:04 -03:00
cypress.config.ts Bug 34319: Upgrade cypress 9.7.0 to 12.17.2 2023-09-05 11:52:25 -03:00
fix-perl-path.PL Bug 28606: Remove $DEBUG and $ENV{DEBUG} 2021-06-24 11:53:44 +02:00
gulpfile.js Bug 35428: Remove temporary files for gulp po tasks 2024-01-03 14:16:31 +01:00
help.pl
INSTALL
Koha.pm Bug 31297: DBRev 23.11.01.002 2024-01-03 16:45:22 +01:00
koha_perl_deps.pl
kohaversion.pl
LICENSE
mainpage.pl Bug 35019: Add a CSRF token when deleting news 2023-10-20 17:22:02 -03:00
Makefile.PL Bug 29002: Update Makefile 2023-11-03 12:04:27 -03:00
MANIFEST.SKIP Bug 9546 : Updating make manifest tardist 2013-02-06 23:54:46 -05:00
package.json Bug 34319: Upgrade cypress 9.7.0 to 12.17.2 2023-09-05 11:52:25 -03:00
README
README.md
README.robots
rewrite-config.PL
tsconfig.json
webpack.config.js Bug 30708: Vue app 2023-10-18 15:41:40 -03:00
yarn.lock Bug 34319: Update yarn.lock 2023-09-05 11:52:25 -03:00

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo