Problem/Motivation

The site template's functional tests (11 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:

  • One custom step in tests/step-definitions/webship.js is ambiguous with the pack: the login by handle (I am a logged in user with the "..." user). It matches the same sentences as the pack's, so every such sentence matches two definitions once the pack is loaded. The other step in the file, I login with the "..." user, repeats the same login under another sentence.
  • The custom login waits a fixed 3000 ms for Honeypot (HONEYPOT_LOGIN_TIME_LIMIT_MS); the pack does this with loginWait, which cucumber.js does not set.
  • The users registry in cucumber.js has the old shape: Admin, Authenticated user and Content editor with name, email and password, while the pack reads username, roles and isAdmin. scripts/webship.users.yml lists the same accounts for scripts/add-testing-users.sh.
  • CI installs the recipe and checks configuration and content counts (the recipe job), but no job runs the 11 feature files (16 scenarios).

Related: #3635935 (Node.js 24 and Yarn 4.18.1).

Steps to reproduce

  1. Read cucumber.js and tests/step-definitions/webship.js on the 1.0.x branch.
  2. The custom login step matches the same sentences as the pack's.
  3. Read the users block of cucumber.js (name, not username) and the jobs of .gitlab-ci.yml: none runs the suite.

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. Change the users registry in cucumber.js to the pack's shape: username in place of name, plus roles and isAdmin. Set loginWait to 3000, since the site template protects the login form with Honeypot.
  3. Remove the custom login by handle from tests/step-definitions/webship.js. Use the pack's sentence in place of I login with the "..." user in the one feature that uses it, so that the file can go.
  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. Add a webship-js-test CI job that runs the suite against the site the recipe job installs, with Node 24 and Playwright, modelled on the job of the Drupal Website API Starter site template. Check the Composer and npm constraints against the current releases and name the ones that change in the merge request.
  6. One merge request on the 1.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 b088827e on 1.0.x
    task: #3636724 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.