WebAssert should return the found links

Created on 8 March 2019, over 5 years ago
Updated 11 June 2024, 4 months ago

Problem/Motivation

WebAssert's linkExists, linkExistsExact and linkByHrefExists don't return the found links.
This is an inconsistency. Other "exists" methods of the WebAssert class do return the found elements.

When a test needs to click a link, developers are forced to write something like:

$assert_session->linkExists('Remove section');
$this->clickLink('Remove section');

This could be simplified:

$assert_session->linkExists('Remove section')->click();

Proposed resolution

The functions should return the matching elements.

API changes

Return values change from void to \Behat\Mink\Element\NodeElement.

Feature request
Status

Closed: duplicate

Version

11.0 🔥

Component
PHPUnit 

Last updated 1 day ago

Created by

🇭🇺Hungary bendeguz.csirmaz

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024