Set the node-modules linker so the functional test suite can load its step definitions
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3621425. -->
Reported by: [rajab natshah](https://www.drupal.org/user/1414312)
Related to !17
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The functional test suite of Varbase Media Header cannot load a single step definition from @vardot/varbase-e2e, so every library step is undefined and no scenario can run. On the 10.1.x branch as it stands today: <strong>13 scenarios, all 13 undefined; 64 steps, 50 undefined and 14 skipped</strong>.</p>
<p>This is pre-existing. It reproduces on a completely untouched checkout of 10.1.x, with the current <code>"@vardot/varbase-e2e": "^2"</code> constraint left alone.</p>
<p>The cause is the install layout. This project has no <code>.yarnrc.yml</code>, so Yarn 4 defaults to Plug'n'Play: it writes a <code>.pnp.cjs</code> and never creates a <code>node_modules</code> directory. But <code>cucumber.js</code> loads the library steps with the glob <code>node_modules/@vardot/varbase-e2e/tests/step-definitions/**/*.js</code>. Under Plug'n'Play that path does not exist and a glob cannot look inside a PnP zip, so the pattern matches nothing, silently. Only the project's own <code>tests/step-definitions/</code> steps load.</p>
<p>Every Varbase project whose suite does work carries <code>nodeLinker: node-modules</code> in <code>.yarnrc.yml</code> — 19 of them do. Varbase Media Header is one of the four that do not.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ol>
<li>Check out the 10.1.x branch, unchanged.</li>
<li>Run <code>yarn install</code>. Note that no <code>node_modules</code> directory appears, and a <code>.pnp.cjs</code> does.</li>
<li>Run <code>yarn cucumber-js --dry-run</code>. Every library step reports Undefined.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Add a <code>.yarnrc.yml</code> with <code>nodeLinker: node-modules</code>, which is what the other 19 Varbase projects already do. That restores a real <code>node_modules</code> tree, so the existing glob in <code>cucumber.js</code> resolves and the library steps load. Nothing in <code>cucumber.js</code> needs changing, and no clever PnP-aware require is introduced.</p>
<p>Verified, not reasoned about: after the change the dry run is <strong>13 scenarios and 64 steps, all skipped</strong>, with zero undefined and zero ambiguous steps.</p>
<p>The <code>@vardot/varbase-e2e</code> constraint is also moved from <code>^2</code> to <code>^2.0.4</code> in the same change, and the lock refreshed. That bump rides along deliberately: until a step can load at all, a version bump here has no observable effect, so shipping it separately would have been a change that proves nothing. <a href="https://github.com/Vardot/varbase-e2e/releases/tag/2.0.4">2.0.4</a> adds 17 built-in steps — access assertions, page title assertions, an added HTTP status phrasing — and makes the existing HTTP status step session aware, where it used to re-request the URL outside the browser and so lose the session cookies and follow redirects.</p>
<p>AI-Generated: Yes</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>✅ File an issue</li>
<li>✅ Addition/Change/Update/Fix</li>
<li>✅ Testing to ensure no regression</li>
<li>➖ Automated unit/functional testing coverage</li>
<li>➖ Developer Documentation support</li>
<li>➖ User Guide Documentation support</li>
<li>➖ UX/UI designer responsibilities</li>
<li>➖ Accessibility and Readability</li>
<li>❌ Reviewed by a human</li>
<li>❌ Code review by maintainers</li>
<li>❌ Full testing and approval</li>
<li>❌ Credit contributors</li>
<li>❌ Review with the product owner</li>
<li>✅ Update Release Notes</li>
<li>✅ Release</li>
</ul>
<h3 id="summary-ui-changes">User interface changes</h3>
<ul>
<li>N/A</li>
</ul>
<h3 id="summary-api-changes">API changes</h3>
<ul>
<li>N/A</li>
</ul>
<h3 id="summary-data-model-changes">Data model changes</h3>
<ul>
<li>Install layout only: the project now installs into <code>node_modules</code> instead of Yarn Plug'n'Play.</li>
</ul>
<h3 id="summary-release-notes">Release notes snippet</h3>
<ul>
<li>The functional test suite can load its step definitions again, and now requires @vardot/varbase-e2e 2.0.4 or newer.</li>
</ul>
issue
GitLab AI Context
Project: project/varbase_media_header
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/varbase_media_header/-/raw/10.1.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/varbase_media_header
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD