Commit Graph

613 Commits

Author SHA1 Message Date
Veloman Yunkan
091e9370e9 Automatic wombatization in case of updated test data 2026-03-17 14:43:49 +04:00
Veloman Yunkan
e8dcf14fad Testing of an inter-page link with a hash
Added testing of an internal inter-page link with a fragment component.

Existing references to entries in issues.html served as such links
(which is how the bug was noticed), however it is better to have
a dedicated row in the test matrix for such a case.
2026-03-17 14:43:49 +04:00
Veloman Yunkan
755da7c255 Testing of links on a dynamic page
Note that the test dynamic page uses assignment to innerHTML (the method
of DOM manipulation is important in the context of interaction with
wombat.js which may not fully and correctly handle all the possible ways
in which dynamic content may appear).
2026-03-17 14:43:49 +04:00
Veloman Yunkan
cb15d155f6 Added testing results for wombatized pages 2026-03-17 14:43:49 +04:00
Veloman Yunkan
75f98b88ef Wombatization of test pages
Added a script for wombatization of test pages
2026-03-17 14:43:49 +04:00
Veloman Yunkan
db423a5ba9 Added a nested iframe test page
Also added a column to the test matrix table corresponding to this
additional dimension of testing.
2026-03-17 14:43:49 +04:00
Veloman Yunkan
75e34fa6e2 Enter test data for viewer testing
Added test data for centralized manual testing of various corner cases
of the kiwix-serve frontend.
2026-03-17 14:43:49 +04:00
Veloman Yunkan
0021f2b336 A unit test for removeAccents() 2026-02-27 19:35:42 +04:00
Veloman Yunkan
b773e93a95 Negative unit tests for starting the server 2026-02-23 18:14:09 +04:00
Veloman Yunkan
e481164258 Extracted test/testing_tools.h 2026-02-23 18:09:33 +04:00
Emmanuel Engelhart
f29c69aac6 No pagination for Atom feed URL
New cache busting id for skin/index.js
2026-02-23 10:13:10 +01:00
Veloman Yunkan
9493c092ad Updated/regenerated static/skin/languages.js 2026-02-12 17:32:41 +04:00
Veloman Yunkan
b6a13d9b03 Minor cosmetic clean-up
Performed minor cosmetic clean-up in the ServerSearchTest.searchResults
unit-test:

1. Fixed alignment in test data
2. Moved the test point for search query "yellow submarine" out of the
   set of test points for search query "jazz"
2026-01-12 12:21:56 +04:00
pippotadde
86f125f8fb Fix: avoid error on empty search pattern 2026-01-12 12:18:53 +04:00
pippotadde
3cd8554733 Tools: Add kiwix::trim() helper and unit tests 2025-12-28 20:31:51 +01:00
pippotadde
0ad2710884 Tests: add yellow submarine search case 2025-12-23 17:02:52 +01:00
pippotadde
ab31ed9ca5 Tests: deduplicate yellow search results 2025-12-23 17:01:13 +01:00
pippotadde
19d9bc36c8 Frontend: guard empty search input 2025-12-23 14:30:42 +01:00
Veloman Yunkan
ca808718f7 Fix for kiwix-serve --nosearchbar
In kiwix-serve --nosearchbar mode the viewer is still engaged and
its setup must completed appropriately, otherwise the content requested
via the URL is not loaded.
2025-11-28 17:16:24 +04:00
Veloman Yunkan
8b0f01fa9b Fix for intermittent /content/blank.html errors
Monitoring of the iframe content URL could result in the check being
performed while the iframe placeholder page /skin/blank.html was still
loaded (a slow connection increased the odds of it happening). This was
contrary to the assumptions behind the logic of that procedure and the
outcome was an attempt to load the /content/blank.html page with a
subsequent 404 error.

Now that situation is taken into account.
2025-11-27 17:55:14 +04:00
Emmanuel Engelhart
e9e76e0901 Adapt tests to results offset starting at 0 2025-10-24 12:24:20 +02:00
Veloman Yunkan
e402dcabcb Another way of testing that an existing spellings DB is reused
Under Windows and Packages CI workflows the previous approach to testing
that an existing spellings DB file is reused didn't work since it relied
on an auxiliary test ensuring that a spellings database cannot be
created in a read-only directory, whereas

1. under Windows a temporary directory couldn't be made read-only
   (leading to the failure of the auxiliary test)

2. in the Packages workflow the build was run with root privileges
   and the read-onliness of the target directory was ignored
   (leading to the same failure).

So the test was rewritten to actually check the content of the target
directory as well as the modifications times of the target directory and
the database file.
2025-10-09 17:15:17 +04:00
Veloman Yunkan
54bd29e3ed A more portable spelling correction unit-test
Packages workflow jobs run under Ubuntu 22.04 Jammy and 24.04 Noble with
different versions of libxapian.so. So the spelling correction unit test
must adapt accordingly.
2025-10-09 15:08:04 +04:00
Veloman Yunkan
5c8aa240ad SpellingsDB is created in a cache directory
The path parameter of the SpellingsDB constructor has been changed to
denote the path of the cache directory where spellings databases for
different ZIM archive should be stored. The filename of the spellings
database is generated from the ZIM archive UUID and the current version
of the spellings database implementation.
2025-10-06 17:20:22 +04:00
Veloman Yunkan
39672f0532 SpellingsDB reuses an existing database
Also the underlying Xapian database is now in a single-file format.
2025-10-06 17:20:13 +04:00
Veloman Yunkan
e0491adc85 Extracted testSpellingCorrections()
... so that it can be reused in a test where an existing spellings
database is opened.
2025-10-06 17:19:42 +04:00
Veloman Yunkan
286649e8c3 Enter SpellingsDB 2025-10-06 17:19:32 +04:00
Veloman Yunkan
b799c0648b ZIM file for testing spelling correction
The ZIM file test/data/spelling_correction_test.zim was generated using
the script test/data/create_zim_file_for_testing_spelling_correction
included in this commit.
2025-10-02 20:02:08 +04:00
Veloman Yunkan
67b7e25494 Empty root isn't confused with missing contentServerURL
Running kiwix-serve without --catalogOnly and
--urlRootLocation resulted in non-clickable book tiles since
empty root was confused with empty contentServerURL which controlled
whether book preview links should be activated.

This commit fixes that bug and adds respective unit-tests.
2025-09-13 18:34:02 +04:00
Veloman Yunkan
208dd96edd Catalog-only mode of nojs welcome page 2025-09-08 18:52:50 +04:00
Veloman Yunkan
51ffa31037 Book preview link is derived from the content URL
Now the book preview link is derived from the content URL link found in
the OPDS entry for a book.  If no content URL is present in the OPDS
entry for a book, then preview link is disabled.
2025-09-08 18:39:48 +04:00
Veloman Yunkan
968d1c1067 Support for setting the content server URL 2025-09-08 18:39:48 +04:00
Veloman Yunkan
25e03ce597 Support for catalog-only mode 2025-09-08 18:39:48 +04:00
Veloman Yunkan
8a3c4c92e0 Enhanced test library.xml with an entry not backed by a ZIM file
The test data was modified so that support for catalog only mode
of kiwix-serve can be properly tested.

The effect of this change in the test data on the library_server unit
test demonstrates that although the new entry does not appear in the
catalog (for example, no catalog_v2_entries* test cases were affected)
the category and language of this ghost entry slipped into the
observable output.
2025-09-08 18:39:48 +04:00
Veloman Yunkan
26253ebf8f Viewer iframe location is checked every 0.1s
The only way to detect change of the iframe location performed via
`History.pushState()` or `History.replaceState()` is to constantly
monitor it, since those methods don't trigger any events.
2025-09-08 12:51:10 +04:00
Veloman Yunkan
34c6a3bfab Viewer detects & tracks intrapage navigation too
Clicking intrapage links (of the form <a href="#anchor">) inside the
viewer iframe is detected by the viewer and reflected in the URL in the
address bar.

The solution only works if following the link is performed by the
browser as a default action. It doesn't work if the changed URL in the
address bar after clicking a link is a result of `History.pushState()`
or `History.replaceState()` being called by javascript code installed as
an event handled on the link (which is the case in single page
applications).
2025-09-01 16:37:38 +04:00
Veloman Yunkan
334ca0295e Viewer chaperon mode
Viewer now rewrites internal links so that opening them in a new
tab/window keeps the viewer around. Thus the viewer acts as a chaperon
for the users preventing them from finding themselves out of the
viewer's supervision. Of course there are ways to circumvent such
oversight, however it has always been the case with chaperons in all
cultures in all epochs.
2025-09-01 12:31:41 +04:00
Veloman Yunkan
b8d975068e Updated/regenerated static/skin/languages.js 2025-08-15 12:00:10 +04:00
Emmanuel Engelhart
850e330461 First kiwix-serve print.css 2025-06-13 10:21:00 +02:00
Emmanuel Engelhart
33bb0141c0 Default white background for kiwix-serve iframe/body 2025-06-10 16:45:36 +02:00
Emmanuel Engelhart
c4ced73f7c Update cacheid for kiwix.css 2025-06-08 09:35:21 +02:00
aditii2712
5729b6540c Fixing placeholder text in search bar input field. 2025-06-02 11:56:40 +04:00
Veloman Yunkan
be69584637 Additional error info on the HTTP 500 error page
Additional error info (text of the exception thrown by low level C++
code) is shown inside a text box of the same style as used for the
advice on the 404 error page (we either need to change the name of the
CSS style, or introduce a separate style for this piece of information).
2025-05-22 15:29:09 +04:00
Veloman Yunkan
2ba29f76e1 Nicer Internal Server Error page
Updated the Internal Server Error page to match the 404 (Content Not
Found) error page.
2025-05-22 15:29:05 +04:00
Veloman Yunkan
3cd1f7854a Fully translated external link blocker page 2025-05-14 21:40:23 +04:00
Veloman Yunkan
58a211d01d Renamed a parameter in external link blocker template 2025-05-14 21:37:52 +04:00
Veloman Yunkan
07fc40da5a Translation works on external link blocker
This comes at the cost of broken support for SeaMonkey (due to usage of
import.meta in i18n.js)
2025-05-14 21:36:43 +04:00
Veloman Yunkan
d961447e1e Started translating the external link blocker page
The external link blocker page isn't actually translated since it is not
managed by the viewer. Will port the translation code from the viewer.js
in next commit.
2025-05-14 21:35:29 +04:00
Veloman Yunkan
c9ebeb7b96 New external link blocker page
The page doesn't support translation yet.
2025-05-14 21:34:14 +04:00
Veloman Yunkan
2d73ed31a9 Handling translation in ServerTest.HttpSexy404HtmlError
The failing test point in the ServerTest.Http404HtmlError unit-test
has been superseded by the enhanced ServerTest.HttpSexy404HtmlError
unit-test, resulting in a clean test-suite.
2025-05-14 21:30:05 +04:00