Skip to content

WIKI FREE TEST CASES

opencode edited this page Oct 6, 2026 · 3 revisions

Free Test Cases Report — Modernized Screen

The Free Test Cases report (ASIDE → Reports → Test Cases not Assigned to Any Test Plan) lists all test cases in the active test project that are NOT linked to any test plan — one row per test case, grouped by test suite. It replaces the legacy 1.9.20 lib/results/freeTestCases.php HTML view with a modern Dashio-styled page backed by a plain-PHP REST BFF.

Path: ASIDE menu → Reports → Test Cases not Assigned to Any Test Plan URL: gui/templates/results/freeTestCases.html?tproject_id=<id> BFF API: api/reports/index.php — GET ?action=free_testcases&tproject_id=N Rights: testplan_metrics Tracking issue: #751


Table of Contents

  1. Screen Layout
  2. Data Flow and Parity
  3. i18n
  4. Permission Path and Empty State
  5. BFF API Reference
  6. Files

1. Screen Layout

Section Description
Header Teal Dashio header "Test Cases Not Assigned to Any Test Plan — for test project X" with locale switcher
Toolbar Dark bar: test project context, match count badge
Report DataTable with columns: Test Suite (path), Test Case (external ID + name), Importance (conditional on priority setting)
Report info Italic paragraph below the grid (ftc.infoReport): "This report shows all test cases that have not been added to ANY test plan of this project." — rendered only in the has-data path (legacy freeTestCases.tpl:36 parity; added in gap Issue #1264)
Empty state Info icon with localized message when all test cases are assigned or no free test cases exist
Footer Elapsed time + "Generated by TestLink on <timestamp>" (legacy freeTestCases.tpl:38 parity; added in gap Issue #1265)

2. Data Flow and Parity

The BFF calls exactly the same engine method as the legacy controller:

  1. testproject::getFreeTestCases($tprojectId) — fetches all test case IDs in the project, fetches those linked to any test plan, then computes the difference (free = all − linked). If no test plans exist (allfree=true), all test cases are returned.
  2. Row post-processing: tree::get_full_path_verbose() resolves the test suite path; the full external ID is built from prefix + glue + external_id.
  3. Columns match legacy: Test Suite, Test Case, Importance (shown only when priority management is enabled for the test project).
  4. Table is grouped by test suite and sorted by importance (descending), same as legacy tlExtTable behavior.
  5. Footer (Issue #1265): the BFF success payload emits generated_on (date('Y-m-d H:i:s'), same convention as tplan_with_cf / metrics), and the HTML renderFooter(d) helper renders common.generatedBy + generated_on in all three footer branches (data / warning / all-assigned). The generated-on segment degrades gracefully when the key is absent.
  6. Report info (Issue #1264): in the has-data branch loadData() appends a localized <p class="info reportinfo"> immediately after the results section, so the DOM order matches legacy freeTestCases.tpl:31-38 (table → italic info → generated-on footer). BFF unchanged — the info text is presentational (new ftc.infoReport key).

3. i18n

8 ftc.* keys in all 10 locale bundles (en de es fr it ja pt ro ru zh) plus the shared footer key common.generatedBy ("Generated by TestLink on", Issue #1265):

Key English
ftc.header Test Cases Not Assigned to Any Test Plan
ftc.forProject for test project
ftc.testProject Test Project
ftc.testCases test cases
ftc.matchCount Match count
ftc.allAssigned All test cases are assigned to a test plan.
ftc.elapsedSeconds Elapsed seconds
ftc.infoReport This report shows all test cases that have not been added to ANY test plan of this project.
common.generatedBy Generated by TestLink on

4. Permission Path and Empty State

  • No session → 401; missing testplan_metrics on global role AND project context → 403
  • All test cases assigned → info icon with ftc.allAssigned message
  • No test plan exists (allfree) → data table displayed with all test cases

5. BFF API Reference

GET ?action=free_testcases&tproject_id=N

Returns project-scoped free test cases.

{
  "status": "ok",
  "tproject_id": 1,
  "tproject_name": "FTC Test Project",
  "priority_enabled": true,
  "all_free": true,
  "has_data": true,
  "rows": [
    {
      "tcase_id": 6,
      "tc_external_id": 1,
      "external_id": "FTC-1",
      "name": "TC Free 1",
      "suite_path": "Suite A",
      "importance": "high"
    }
  ],
  "warning_msg": "",
  "elapsed_time": 0.01,
  "generated_on": "2026-10-06 09:42:50"
}

6. Files

File Purpose
gui/templates/results/freeTestCases.html Modernized HTML/JS screen
api/reports/index.php BFF API (free_testcases action)
lib/general/asideMenu.php Aside link switched to freeTestCases.html for link_report_free_testcases_on_testproject
gui/templates/i18n/{en,ro,de,fr,es,it,ja,pt,ru,zh}.json ftc.* i18n keys
lib/results/freeTestCases.php Legacy controller (reference)
lib/functions/testproject.class.php:2554 getFreeTestCases() method

Clone this wiki locally