Problem/Motivation

Updating to @vardot/varbase-e2e 2.0.4 breaks this test suite: 3 of the 17 scenarios stop with Multiple step definitions match. 2.0.4 ships a Drimage Improved step pack — ported out of this very suite so every site using the module gets the steps from the package — and its single-image step matches the sentence we define locally:

Then the image "[data-drimage_improved] picture img" should be loaded within 2 seconds
  • Ours: tests/step-definitions/drimage.steps.js:21
  • The library's: drupal-drimage-improved.steps.js:194

Deleting our step is not enough. In the pack, the quoted text is the image's alt text, not a CSS selector: the pack already knows the formatter markup and the /styles/drimage_improved_ derivative path, so its steps carry no selectors. Left as they are, our lines would fail rather than be ambiguous, looking for an image whose alt text is [data-drimage_improved] picture img. The scenarios move to the pack's wording.

The pack also covers more than we did — rendering, webp, the noscript fallback, lazy loading, viewport sizing, broken images, and naming one image by alt text, title, caption or position. docs/steps/drupal-drimage-improved.md.

Steps to reproduce

  1. On 1.0.x, run npm install so @vardot/varbase-e2e resolves 2.0.4. Add --format progress to the run: unrelated to this issue, the configured @cucumber/pretty-formatter fails to load against the installed Cucumber, at the untouched 1.0.x tip too.
  2. Run npx cucumber-js --dry-run. No site, no browser: the run stops before that.
Then the image "[data-drimage_improved] picture img" should be loaded within 2 seconds
    Multiple matching step definitions found:
      ...drupal-drimage-improved.steps.js:194
      ^the image "([^"]*)" should be loaded...$ # tests/step-definitions/drimage.steps.js:21

17 scenarios (14 skipped, 3 ambiguous)
244 steps (241 skipped, 3 ambiguous)

Proposed resolution

  • Delete tests/step-definitions/drimage.steps.js; the pack supersedes it.
  • Move the assertions in tests/features/drimage/*.feature to the pack's wording: the drimage images should be rendered / should be loaded / should offer webp / should have a noscript fallback.
  • Keep one raw selector — the @webp-off negative check, since the pack has no negative webp step.
  • Require @vardot/varbase-e2e ^2.0.4; the pack does not exist before it.
  • Point the README at the pack instead of documenting a local step, and reword the cucumber.js comment.

Dry-run after the change: 17 scenarios, 244 steps, nothing ambiguous, nothing undefined. The merge request pipeline is fully green, including all four functional-acceptance browser jobs (base, focal_point, image_widget_crop, webp_off) — so the rewritten scenarios pass against real sites, not just at parse time.

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

  • None. This is the test suite only.

API changes

  • None.

Data model changes

  • None.

Release notes snippet

  • Test suite: the Drimage assertions now come from the Drimage Improved step pack in @vardot/varbase-e2e 2.0.4, using its selector-free wording.
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’s picture

Issue summary: View changes

  • rajab natshah committed 87f80799 on 1.0.x
    fix: #3621374 Move the Drimage assertions to the varbase-e2e step pack
    
rajab natshah’s picture

Assigned: Unassigned » josebc
Status: Active » Needs review
Issue tags: +drimage_improved-1.0.13

✅ Released 1.0.13

rajab natshah’s picture

Assigned: josebc » mohammed j. razem
Status: Needs review » Reviewed & tested by the community
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
Status: Reviewed & tested by the community » 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.