From 4056ad21538d69929c331fb57a9dac72d1288de9 Mon Sep 17 00:00:00 2001 From: Victor Grousset/tuxayo Date: Thu, 19 Nov 2020 13:47:45 +0100 Subject: [PATCH] WIP Bug 27055: Fix compatibility with newer Selenium+Firefox version Fix "submit is not a function error" A submit button should be named "submit", in this case, it's id. https://stackoverflow.com/questions/833032/submit-is-not-a-function-error-in-javascript WIP: 1. Fix SCSS which used the id=submit 2. Fix other tests, there are major issues like crash at the beginning or endless duration == Test plan == 1. Update selenium/standalone-firefox to the latest version [1] 2. prove t/db_dependent/selenium/authentication.t 3. It fails with: arguments[0].form.submit is not a function 4. Apply patch 5. Retest 6. Success [1] In koha-testing-docker you can do it with docker-compose.yml selenium: - image: selenium/standalone-firefox:2.53.1-americium + image: selenium/standalone-firefox --- koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 2 +- t/lib/Selenium.pm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt index b980f1e3af..046f288bcf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -112,7 +112,7 @@ -

+

[% IF ( casAuthentication ) %]

Cas login

diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm index 261502aae1..d3910c56ca 100644 --- a/t/lib/Selenium.pm +++ b/t/lib/Selenium.pm @@ -103,8 +103,8 @@ sub auth { $self->driver->get($mainpage); $self->fill_form( { userid => $login, password => $password } ); - my $login_button = $self->driver->find_element('//input[@id="submit"]'); - $login_button->submit(); + my $login_button = $self->driver->find_element('//input[@id="submit-button"]'); + $login_button->click(); } sub opac_auth { -- 2.29.2