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
- On
1.0.x, runnpm installso@vardot/varbase-e2eresolves 2.0.4. Add--format progressto the run: unrelated to this issue, the configured@cucumber/pretty-formatterfails to load against the installed Cucumber, at the untouched 1.0.x tip too. - 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/*.featureto 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-offnegative 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.jscomment.
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.
Issue fork drimage_improved-3621374
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
Comment #3
rajab natshahComment #5
rajab natshah✅ Released 1.0.13
Comment #6
rajab natshahComment #7
rajab natshah