When running default tests for my project Behat throws an error because of ambiguity between two step definitions.

The Lightning Core declared step definition for "When I visit..." EntityContext.behat.inc:81 uses Gherkin tokens for the optional "a or an" string which conflicts with a custom step definition @When I visit :type :title defined, to be used in the following way When I visit article "Test article". Because article begins with "a" Behat considers it a match for the Lightning Core step as well as the custom step.

My suggested solution is to replace the token with regexp.

CommentFileSizeAuthor
#2 lightning-core_when-I-visit-2955092-2.patch672 bytesGRO
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GRO created an issue. See original summary.

GRO’s picture

GRO’s picture

Title: "When I visit" step definition is too general » Tests: "When I visit" step definition is too general
phenaproxima’s picture

This looks good to me. I'll open a PR for Lightning Core and merge it if tests pass.

  • phenaproxima authored 4565ba2 on 8.x-1.x
    Issue #2955092 by GRO: Tests: "When I visit" step definition is too...

  • phenaproxima authored 48035df on 8.x-2.x
    Issue #2955092 by GRO: Tests: "When I visit" step definition is too...
phenaproxima’s picture

Status: Active » Fixed

Committed to 8.x-2.x and cherry-picked to 8.x-1.x. Thank you!

  • phenaproxima authored 1e5c915 on 8.x-3.x
    Issue #2955092 by GRO: Tests: "When I visit" step definition is too...

Status: Fixed » Closed (fixed)

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