Problem/Motivation

The module's functional tests (5 feature files) run on webship-js, with the step definitions and the settings kept in the project itself (cucumber.js, tests/step-definitions/).

The public step pack @webship-js/drupal-core-steps 2.1 (npm, GitHub) now ships, for any Drupal core site:

  • login by handle (verified, with a Honeypot-aware loginWait) and Given I add the testing users from the users registry
  • named administration pages, status messages, listings and operations
  • the media library, CKEditor and access control (I should be denied access to "...")
  • site structure assertions, Layout Builder steps, a selector preset and the complete default settings

Local copies drift from the pack and duplicate its maintenance. In this project:

  • Two custom steps in tests/step-definitions/cucumber_demos.steps.js are ambiguous with the pack: the login by handle (I am a logged in user with the "..." user) and I add the testing users. Both match the same sentences as the pack's, so every such sentence matches two definitions once the pack is loaded. The other three custom steps (the field and button steps) are kept.
  • The default branch is 11.0.x: it requires drupal/cucumber_core and drupal/cucumber_recipes at 11.0.x-dev and its yarn.lock resolves webship-js 2.0.5. The supported 12.0.x is at release 12.0.2.
  • engines.node is >= 20.0 with packageManager yarn@4.9.3, and the CI jobs use node:20 and NodeSource setup_20.x.

Steps to reproduce

  1. Read cucumber.js and tests/step-definitions/ on the 12.0.x branch.
  2. The custom login step and the testing-users step match the same sentences as the pack's.
  3. Read package.json (engines.node, packageManager) and the image: lines of .gitlab-ci.yml, and compare the default branch 11.0.x with 12.0.x.

Proposed resolution

The pack's 2.1.0 is on npm.

  1. Add @webship-js/drupal-core-steps (^2.1.0) to the package.json devDependencies and its step glob (node_modules/@webship-js/drupal-core-steps/tests/step-definitions/**/*.js) to cucumber.js, between webship-js's own glob and the project's own. webship-js stays at ^2.0.6.
  2. The users registry in cucumber.js already has the pack's shape (username, email, password, roles, isAdmin); keep it.
  3. Remove the two custom steps the pack now provides (the login by handle and I add the testing users) from tests/step-definitions/cucumber_demos.steps.js; keep the rest.
  4. Add a test:dry script (cucumber-js --dry-run) and a dry run in CI before the browser job, so an undefined or ambiguous step fails early.
  5. Set the default branch to 12.0.x. Move to Node 24 and Yarn 4.18.1: engines.node >= 24.0, packageManager yarn@4.18.1, the CI images node:24 and NodeSource setup_24.x. Regenerate yarn.lock so that it resolves the pack. Check the other constraints against the current releases.
  6. One merge request on the 12.0.x branch from an issue fork, pipeline green, then a release.

AI-Generated: Yes (issue text)

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ✅ Automated unit/functional testing coverage
  • ❌ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ 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

  • N/A

Release notes snippet

  • The automated tests run on the @webship-js/drupal-core-steps step pack; CI runs a dry run first.

Comments

rajab natshah created an issue. See original summary.

  • rajab natshah committed 8269fe04 on 3636736-drupal-core-steps
    task: #3636736 Keep Drupal core's Yarn off the project .yarnrc.yml in...

  • rajab natshah committed c4c98ed9 on 3636736-drupal-core-steps
    task: #3636736 Take @webship-js/drupal-core-steps 2.1.1 into the lock...

  • rajab natshah committed 47df0ac6 on 3636736-drupal-core-steps
    task: #3636736 Find the content listing table by its form, not by a...

  • rajab natshah committed 47df0ac6 on 12.0.x
    task: #3636736 Find the content listing table by its form, not by a...

  • rajab natshah committed c4c98ed9 on 12.0.x
    task: #3636736 Take @webship-js/drupal-core-steps 2.1.1 into the lock...

  • rajab natshah committed 8269fe04 on 12.0.x
    task: #3636736 Keep Drupal core's Yarn off the project .yarnrc.yml in...

  • rajab natshah committed fa02f2e0 on 12.0.x
    task: #3636736 Use @webship-js/drupal-core-steps 2.1 for the webship-js...
rajab natshah’s picture

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.