Repository navigation
Bugfix Issue 2101 Test Strategy Report Authored Sections PDF

Issue #2101 asked for per-section input areas for the Test Strategy, aggregation of
those texts into the Test Strategy report, and export of the resulting strategy to
PDF. Investigation on a freshly imported 2.0.1 database showed that the nine section
textareas already existed (gui/templates/strategy/strategyDoc.html:176-184, backed by
api/strategydoc/index.php), but the generated report
(api/strategyreport/index.php) never read testproject_strategy_docs and the report
toolbar had no PDF action. A document with a filled Exit Criteria round-tripped through
the strategy-document API yet its text never appeared anywhere in the report.
The authoring half (#1943) and the generated report half (#1925) were implemented separately and never wired together:
-
api/strategyreport/index.phpassembled onlycontext, scope, types, levels, environments, tooling, team, related, signals— measuredGET action=initresponse had noauthoredkey at all. -
gui/templates/results/strategyReport.htmlexported Markdown and HTML and offered a generic Print action (window.print()), but no PDF-labelled action. - The report's published 10 panels ended with assumptions; there was nowhere for project-authored text to render.
- The 18 static ISTQB chapter pages are read-only reference material; converting all of them into editable forms would be an architecture-sized change, beyond a minimal fix for the already-existing editor.
-
Aggregate in the BFF, not in the browser.
api/strategyreport/index.phpnow readstestproject_strategy_docsfor the addressed project, decodes the JSON section blob into the same nine canonical keys used by the authoring API, and returns an additiveauthored[]array with metadata (id, name, status, version, author, updated). The read is gated bymgt_view_tcORmgt_modify_tcon that project — the same right as the strategy-document reader — so report viewers without that right receive an empty array instead of leaked content. ASHOW TABLES LIKEprobe keeps freshly imported databases working when the lazily-created table does not exist yet. Author logins are resolved in one batchedWHERE id IN (...)query (code-review finding). -
Render and export from one source of truth. The screen adds panel 10,
10. Authored Test Strategy sections, reusing the existingsdoc.sec_*heading keys and escaping every dynamic value withesc().buildMarkdown()appends the same documents and sections after the assumptions section, so the Markdown and HTML exports both carry the authored Exit Criteria. -
PDF via the established print path. The teal Export PDF button calls
window.print(), which in Chrome opens the print dialog where Save as PDF produces the file; the existing@media printrules hide the toolbar, header and footer and give each panel a printed border. This avoids a server-side PDF library and matches existing repo screens (reportPrint.html,printTestDoc.html).
- A server-side PDF generator (TCPDF/Dompdf) would add a dependency and a new write path for a capability the browser already provides.
- Making all 18 static strategy chapter pages editable would require a new schema and a second persistence workflow; the issue's concrete example (Exit Criteria) is already editable in the authored document.
- Reusing
testplan_metricsalone to expose authored text would widen strategy-document read rights and break the parity withapi/strategydoc/index.php.
-
api/strategyreport/index.php— authored payload, rights gate, batched author lookup. -
gui/templates/results/strategyReport.html— panel 10, Markdown block, PDF button. -
gui/templates/i18n/{de,en,es,fr,it,ja,pt,ro,ru,zh}.json—strat.exportPdf,strat.secAuthored,strat.authoredEmptyin every bundle. -
tmp/TLU_Test_Cases.md— regression suiteRegression — Issue #2101. -
docs/screenshots/issue-2101-authored-sections.png— post-fix browser screenshot.
- Repro before: HTTP 200 with no
authoredkey, no panel, no PDF action. - After:
authored[0].sections.exit_criteriareturned and rendered; the patchedwindow.print()counter incremented once on clicking Export PDF; empty project 2 showed the localized empty state; Markdown export carried all three section texts. - Gates:
php -l clean, extracted JSnode --checkclean, 10 bundlesjson.toolclean,bash ai/verify_i18n_coverage.sh9/9 PASS, suite gate 34 PASS / 0 FAIL. - Console: 0 Error/Warning entries; Event Viewer: only AUDIT log_level 16 rows after the fixture and test run.
- Review caveat: the negative-permission case was verified against the rights gate code and API shape, not with a separate limited-rights browser login; it is a REVIEW rather than an executed PASS. The code-review hardening also added an exact table-name check to the lazy-table probe and collapsed newlines in Markdown document metadata.