drupal-behat icon indicating copy to clipboard operation
drupal-behat copied to clipboard

Fixes PHP TypeError when asserting for a non-visible field

Open mediabounds opened this issue 1 month ago • 0 comments

When asserting for a non-visible field, there is a type error:

Type error: NuvoleWeb\Drupal\DrupalExtension\Context\VisibilityContext::assertElementNotVisible(): Argument #2 ($node) must be of type Behat\Mink\Element\NodeElement, null given, called in vendor/nuvoleweb/drupal-behat/src/DrupalExtension/Context/VisibilityContext.php on line 64

Ironically, this TypeError indicates success—the element could not be found so the argument is null. But the TypeError causes the tests to fail. This PR adjusts the type arguments to allow NULL.

mediabounds avatar Jan 10 '25 14:01 mediabounds