Problem/Motivation

The functional test suite of Varbase Core 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: 3 scenarios, all 3 undefined; 20 steps, 13 undefined and 7 skipped.

This is pre-existing. It reproduces on a completely untouched checkout of 10.1.x, with the current "@vardot/varbase-e2e": "^2" constraint left alone.

The cause is the install layout. This project has no .yarnrc.yml, so Yarn 4 defaults to Plug'n'Play: it writes a .pnp.cjs and never creates a node_modules directory. But cucumber.js loads the library steps with the glob node_modules/@vardot/varbase-e2e/tests/step-definitions/**/*.js. 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 tests/step-definitions/ steps load.

Every Varbase project whose suite does work carries nodeLinker: node-modules in .yarnrc.yml — 19 of them do. Varbase Core is one of the four that do not.

Steps to reproduce

  1. Check out the 10.1.x branch, unchanged.
  2. Run yarn install. Note that no node_modules directory appears, and a .pnp.cjs does.
  3. Run yarn cucumber-js --dry-run. Every library step reports Undefined.

Proposed resolution

Add a .yarnrc.yml with nodeLinker: node-modules, which is what the other 19 Varbase projects already do. That restores a real node_modules tree, so the existing glob in cucumber.js resolves and the library steps load. Nothing in cucumber.js needs changing, and no clever PnP-aware require is introduced.

Verified, not reasoned about: after the change the dry run is 3 scenarios and 20 steps, all skipped, with zero undefined and zero ambiguous steps.

The @vardot/varbase-e2e constraint is also moved from ^2 to ^2.0.4 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. 2.0.4 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.

AI-Generated: Yes

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ✅ Update Release Notes
  • ✅ Release

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • Install layout only: the project now installs into node_modules instead of Yarn Plug'n'Play.

Release notes snippet

  • The functional test suite can load its step definitions again, and now requires @vardot/varbase-e2e 2.0.4 or newer.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

  • rajab natshah committed 189fad58 on 10.1.x
    fix: #3621422 Set the node-modules linker so the functional test suite...
rajab natshah’s picture

Version: 10.1.x-dev » 10.1.66
Issue summary: View changes
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.