Hi, thanks for all the work over the years on this! ❤️
I searched and couldn't find a matching issue (tho #872 covers the same area of the codebase). I'd love to be able to choose to have strict matching when using the named selector (ie named behaves identically to named_exact). It seems currently that the behavior's hardcoded:
|
public function findAll(string $selector, $locator, string $parentXpath) |
|
{ |
|
if ('named' === $selector) { |
|
$items = $this->findAll('named_exact', $locator, $parentXpath); |
|
if (empty($items)) { |
|
$items = $this->findAll('named_partial', $locator, $parentXpath); |
|
} |
|
|
|
return $items; |
|
} |
And the element finder's instantiated directly in the session constructor:
|
public function __construct(DriverInterface $driver, ?SelectorsHandler $selectorsHandler = null) |
|
{ |
|
$this->driver = $driver; |
|
$this->selectorsHandler = $selectorsHandler ?? new SelectorsHandler(); |
|
$this->elementFinder = new ElementFinder($driver, $this->selectorsHandler); |
|
$this->page = new DocumentElement($this); |
|
|
|
$driver->setSession($this); |
|
} |
From my perspective it'd be great to either have a way to override the element finder with my own custom class, or to update the default Mink finder to support switching off fallback partial matching.
Do either of those approaches sound like something you'd consider? If not, is there maybe some other solution?
Thanks!
Hi, thanks for all the work over the years on this! ❤️
I searched and couldn't find a matching issue (tho #872 covers the same area of the codebase). I'd love to be able to choose to have strict matching when using the
namedselector (ienamedbehaves identically tonamed_exact). It seems currently that the behavior's hardcoded:Mink/src/Element/ElementFinder.php
Lines 48 to 57 in 9b08f62
And the element finder's instantiated directly in the session constructor:
Mink/src/Session.php
Lines 42 to 50 in 9b08f62
From my perspective it'd be great to either have a way to override the element finder with my own custom class, or to update the default Mink finder to support switching off fallback partial matching.
Do either of those approaches sound like something you'd consider? If not, is there maybe some other solution?
Thanks!