FriendlyContexts
FriendlyContexts copied to clipboard
Hard to debug when link not found
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.
Issue solved, right?
@Einenlum Partly, there are other places with same issue.