]> git.koha-community.org Git - koha.git/commit
Bug 36916: Do not generate invalid JS or CSS from TestBuilder
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 22 May 2024 08:31:29 +0000 (10:31 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 30 May 2024 08:13:05 +0000 (10:13 +0200)
commit91d58f08ab7e49def54419d47b6cf067269e93ba
tree15baddf193ade1b23d1f77b702978683259a5652
parent0413d06b0e0f9e2bb8ec3bf26a55d445a7df7119
Bug 36916: Do not generate invalid JS or CSS from TestBuilder

TestBuilder generates random strings for branches.opacuserjs and branches.opacusercss which produces invalid JS and CSS.

Selenium has several warnings related to this:

koha-selenium-1   | JavaScript error: http://koha:8080/cgi-bin/koha/opac-user.pl, line 1744: ReferenceError: CLYxPjQ152 is not defined
koha-selenium-1   | JavaScript error: http://koha:8080/cgi-bin/koha/opac-search.pl, line 2069: ReferenceError: CLYxPjQ152 is not defined
koha-selenium-1   | JavaScript error: http://koha:8080/cgi-bin/koha/opac-reserve.pl, line 1351: ReferenceError: CLYxPjQ152 is not defined

Because of the following in the DOM
    <script>
        CLYxPjQ152
    </script>

This patch suggests to set to an empty string by default, to prevent random failure or inconsistent behaviours when testing the UI.

Test plan:
Run t/db_dependent/selenium/authentication.t and watch the selenium
output.
With this patch applied you will not see the "JavaScript error" lines

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a51b46d4bab2989486ea0be05e130066c666fa50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
t/lib/TestBuilder.pm