Test Case Print Modernized - sebiboga/testlink-upgraded GitHub Wiki
The single Test Case Print screen (the "printer-friendly view" launched from the test-case
toolbar, legacy lib/testcases/tcPrint.php) is modernized into a standalone Dashio page
gui/templates/testcases/tcPrint.html backed by a new BFF route
api/testcasesprint/index.php?action=tc_print.
This was the last legacy member of the test-case toolbar family โ tcEdit, tcAssign2Tplan, tcExport and tcCompareVersions were already modernized. With this screen the whole test-design test-case toolset runs on the modern stack.
Parity sign-off (#1335, task bookkeeping issue โ "Nothing missing"): re-verified on a fresh DB (2026-09-21) with fixture
tmp/fixtures_1335.php+ suite 1574 ยท 9/9 PASS intmp/TLU_Test_Cases.md. BFF happy path (full SINGLE_TESTCASE doc: prefix/external id,[Version : n], author, summary, preconditions, steps, execution type, est. duration, importance, custom-field values, requirements, keywords, platforms), deep-link owner resolution withouttproject_id, 400/404/403 error paths (localized banners on screen), Print/Back/Refresh,?locale=roswitch, moderntcView.htmlPrint-button entry point and Event hygiene all confirmed. No product code changes were needed. Screenshot:docs/screenshots/issue-1335-tcprint-normal.png.
-
Navigation: the Print button on the modern test-case viewer
(
testcases/tcView.html) openstcPrint.html?tproject_id=โฆ&testcase_id=โฆ&tcversion_id=โฆin a popup. The legacy viewer printer-friendly buttons (tcView_viewer.tpl,tcViewViewer.inc.tplโopenPrintPreview('tc', โฆ)) andtestcase.class.php::$gui->printTestCaseActionwere switched to the modern screen; a$actions->printTcentry was added inlib/functions/common.php. -
The document is the legacy one. The BFF includes
lib/testcases/tcPrint.phpat top-level scope (chdir+ob_start, exactly like theprint/downloadactions for the Test Specification document), so the battle-testedrenderTestCaseForPrinting()(lib/functions/print.inc.php) generates the identical SINGLE_TESTCASE output: external id + name,[Version : n], author, summary, preconditions, numbered step actions + expected results, execution type, estimated duration, importance, requirements, keywords, platforms. -
Rendering: the screen embeds the returned
body_htmlin a sandboxed srcdoc iframe. Print uses the iframe's ownprint(); Back returns to the originatingtcView.html; Refresh regenerates. Locale switcher included (all 10 bundles gettcprint.*keys). -
Context resolution: the owning test project is taken from
tproject_idwhen given, otherwise derived from the test-case tree path (get_path()โ rootparent_id), matching the legacy controller's behavior on deep links.
- Session auth (401) first; then
mgt_view_tcon the owning test project gates the route (403) โ verified in the browser with a<no rights>user. - 404
testcase_does_not_exists/ 400 missing-id paths always answer JSON (never mixed with the legacy document HTML).
tcprint.title, tcprint.inProject, tcprint.btnPrint, tcprint.btnBack,
tcprint.generating, tcprint.errLoad, tcprint.errNotFound, tcprint.errNoRights,
tcprint.errNotReady, tcprint.errEmpty, tcprint.rendered โ added to all of
de en es fr it ja pt ro ru zh.
- Regression suite 1010 ยท 14/14 PASS in
tmp/TLU_Test_Cases.md: BFF happy path (document JSON), full render (prefix/id, version, author, summary, preconditions, 4 steps, exec type, duration, importance, requirements/keywords/platforms), Print button enables + invokes iframe print, Back href, Refresh, Romanian locale switch, 404 unknown test case, 400 missing id, 403 no-rights user, deep link without project (tree-path owner resolution), modern viewer Print-button switch, legacy viewer printer-friendly switch, i18n bundle completeness, Event Viewer clean. - Parity re-verification suite 1574 ยท 9/9 PASS (Refs #1335): see the sign-off note above.
- Fixing: login as a user without project context logs
getTestCasePrefix()empty-id SQL error + PHP warnings โ filed as GitHub issue #1011 (pre-existing). - Bookkeeping: #1335 (analyzer "nothing missing") โ closed after this re-verification; legacy cleanup tracked in #1336 (Delete legacy tcPrint).