Document FunctionalJavascript test conventions and add CI check for ungrouped/unrecorded tests
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3582633. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !1432 >>> <p>[Tracker]<br> <strong>Update Summary: </strong>[One-line status update for stakeholders]<br> <strong>Short Description: </strong>Document FunctionalJavascript test conventions and add CI check for ungrouped/unrecorded tests<br> <strong>Check-in Date: </strong>MM/DD/YYYY<br> [/Tracker]</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The AI module has a system for running FunctionalJavascript tests in CI that relies on two conventions:</p> <ul> <li>Every new FJS test class must have a <code>@group</code> annotation with the issue number it belongs to, so the filter script (<code>scripts/filter-functionaljavascript-tests.sh</code>) can select the right tests on issue branches.</li> <li>Every FJS test class should set <code>$videoRecording = TRUE</code> so test runs produce video artifacts for debugging.</li> </ul> <p>Currently some test classes only have a module-level group (e.g. <code>@group ai</code>) without an issue number group, and some do not enable video recording. When a test has no issue number group, it will never run on issue branches - only on tags. When video recording is off, debugging test failures in CI becomes significantly harder.</p> <p>There is no documentation explaining these conventions and no CI check that enforces them. Contributors writing new FJS tests have no way to know they need to add an issue number <code>@group</code> and enable video recording unless they study the filter script and base class themselves and might be confused why the tests are not running.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li>Add documentation (under <code>docs/contribute/testing/</code> or similar) explaining the FJS test conventions: the <code>@group {issue_number}</code> requirement, the <code>$videoRecording = TRUE</code> expectation, how the filter script works, and how tests are selected per branch type (tag/main/issue).</li> <li>Add a CI job (or step in an existing job) that scans all FJS test files and reports a warning or failure when a test class is missing an issue number <code>@group</code> annotation or has <code>$videoRecording</code> set to <code>FALSE</code> (or using the default).</li> <li>The CI check could be a simple shell script that greps for <code>@group [0-9]</code> and <code>videoRecording = TRUE</code> in all <code>*Test.php</code> files under <code>FunctionalJavascript/</code> and <code>FunctionalJavascriptTests/</code> directories.</li> <li>Update existing test classes that are missing the issue number group or video recording flag.</li> </ul> <h3 id="summary-ai-usage">AI usage (if applicable)</h3> <p>[x] AI Assisted Issue<br> This issue was generated with AI assistance, but was reviewed and refined by the creator.</p> <p>[ ] AI Assisted Code<br> [ ] AI Generated Code<br> [ ] Vibe Coded</p> <p>- <strong>This issue was created with the help of AI</strong></p>
issue