FriendlyContexts icon indicating copy to clipboard operation
FriendlyContexts copied to clipboard

Hard to debug when link not found

Open umpirsky opened this issue 10 years ago • 2 comments

When link is not found with Behat\MinkExtension\Context\MinkContext:

Scenario: I add image                           # features/merchant/good.feature:54
    Given I add identifier                        # vendor/knplabs/friendly-contexts/src/Knp/FriendlyContexts/Reader/SmartReader.php:46
    And I follow "Skip"                           # Context\MinkContext::clickLink()
      Link with id|title|alt|text "Skip" not found. (Behat\Mink\Exception\ElementNotFoundException)
Created new window in existing browser session.

Which triggers show_cmd.

When link is not found with Knp\FriendlyContexts\Context\MinkContext:

Scenario: I add image                           # features/merchant/good.feature:54
    Given I add identifier                        # vendor/knplabs/friendly-contexts/src/Knp/FriendlyContexts/Reader/SmartReader.php:46
    And I follow "Skip"                           # Context\MinkContext::clickLink()
      Expected to find at least 1 "Skip" link, 0 found (Exception)

Which does not trigger show_cmd.

The solution is to throw ElementNotFoundException in such case.

umpirsky avatar Jul 16 '15 15:07 umpirsky

Issue solved, right?

einenlum avatar Aug 30 '15 21:08 einenlum

@Einenlum Partly, there are other places with same issue.

umpirsky avatar Aug 31 '15 08:08 umpirsky