Skip to content

Test Case Keyword Coverage Modernized

github-actions[bot] edited this page Nov 29, 2026 · 2 revisions

Test Case Keyword Coverage (tcKeywordCoverage) — Modernized (2.0.1)

Issue: #2099. Screen: gui/templates/results/tcKeywordCoverage.html. BFF: api/tckeywordcoverage/index.php.

This net-new read-only project report answers a question the 1.9.20 keyword screens did not: which test cases in a project actually carry design keywords, how many keywords each one has, and where the tagging gaps are. It joins the project's test-case hierarchy, latest tcversions and project-scoped keyword links into a Dashio report with KPIs, verdict banners, coverage/status filters, a detail modal and guarded CSV export.

Why a new screen

The legacy keyword bar chart reported keyword usage across plan executions; it never surfaced design-level keyword coverage of the test-case specification. tcKeywordCoverage classifies the latest version of each project test case as untagged, single (one keyword) or covered (two or more) and promotes untagged cases to a triage list.

Screen

  • Toolbar: Test project selector, Refresh, Export CSV, Coverage filter (All, Untagged, One keyword, Two or more), Status filter (All, Active, Inactive) and Close.
  • Context panel: test project, test-case count, tagged count and suites involved.
  • KPI strip: test cases, tagged, untagged, coverage %, keyword links, suites involved, single-keyword and multi-keyword counts.
  • Verdict banner: no_data, untagged, at_risk (< 50% coverage), watch (< 100%) and complete.
  • DataTable: 9 columns — prefixed external ID, test case, suite path, version, keyword count, assigned keyword names, active/inactive status, coverage verdict and a Details button.
  • Detail modal: row summary, full keyword list with counts and a safe target="_blank" rel="noopener noreferrer" link to the modern tcView.html screen.
  • UTF-8 CSV with BOM, ; delimiter, quoted cells, formula-injection guard and localized filename keyword-coverage-<project_id>.csv; localized 400/401/403/404/405 state cards and a TLi18n locale switcher.

Semantics

  • Scope is the selected (or session) test project; each test case contributes only its highest-numbered tcversion.
  • Keyword links are joined on testcase_keywords.keyword_id = keywords.id with keywords.testproject_id = <project>; keyword rows from other projects can never inflate coverage.
  • Suite path is built from nodes_hierarchy up to (but excluding) the project node; missing paths render as an em dash.
  • mgt_view_tc is checked on the addressed project before data resolution; denials return 403 no_right and write an AUDIT event.
  • Anonymous/expired sessions receive 401 and the screen redirects to login.php?note=expired; wrong HTTP methods receive 405 with Allow: GET, HEAD.

API contract

Case HTTP Code
GET|HEAD action=projects|init|report|detail success 200 ok
Unknown action / invalid tproject_id / missing or invalid tcversion_id 400 invalid_request
Anonymous / expired session 401 not_authenticated / session_expired
Missing mgt_view_tc on the addressed project 403 no_right (AUDIT)
Unknown project / tcversion outside the project 404 project_not_found / testcase_not_found
Non GET/HEAD 405 method_not_allowed (Allow: GET, HEAD)

Security: bffSameOriginGuard() + bffEnforceSession(), integer-only IDs, html_entity_decode on display data, JSON_INVALID_UTF8_SUBSTITUTE guarded json_encode(), nosniff and no-store headers, escaped client rendering and AUDIT logging for denials.

Wiring

  • cfg/reports.cfg.php — tc_keyword_coverage report entry.
  • api/aside/index.php — modern report mapping with project/plan context.
  • lib/functions/common.php — $actions->tcKeywordCoverage.
  • gui/templates/i18n/*.json — 71 tkc.* + footers.tcKeywordCoverage keys in all 10 bundles; ai/verify_i18n_coverage.sh passes 9/9 with 14116 keys.
  • locale/*/strings.txt — $TLS_link_report_tc_keyword_coverage in all 19 server locales.

Verification

  • Fixture tmp/fixtures_2099.php: project TKC2099, two suites, five test cases (3 tagged / 2 untagged, 5 keyword links, 60% coverage, verdict watch) and role-3 viewer tkcnorights without mgt_view_tc.
  • BFF contract verified for projects, init, report, detail, HEAD, anonymous 401, role-3 403, invalid 400, unknown project 404, unknown tcversion 404 and POST 403/405.
  • Browser-verified EN/RO: ASIDE launcher, normal/filtered/detail/CSV/refresh/close states, DataTables search, empty filters, anonymous redirect and role-3 no-right card.
  • Suite Issue #2099: BFF contract, metrics, filters, browser states, modal, CSV, RO locale, permissions, errors, i18n and Event Viewer all PASS; suite gate reports 34 PASS / 0 FAIL / 0 SKIP.
  • Bug #2100 (initial BFF SQL emitted literal ? placeholders in an IN (...) clause, causing MariaDB 1064 and two DATABASE ERROR rows) was filed with the bug label, fixed by integer-only ID list assembly, browser-reverified and closed.
  • PHP lint, JSON validation, i18n coverage and suite gates pass. Event Viewer has 0 new Error/Warning rows after all tests.

Screenshots

Normal report with KPI strip and coverage banner Coverage and status filters applied Keyword coverage detail modal Romanian locale No-right 403 card

Clone this wiki locally