pest icon indicating copy to clipboard operation
pest copied to clipboard

Documentation for the $page->click() method say it accepts options.

Open actengage opened this issue 3 months ago • 1 comments

Unless I am missing something here, the docs say this for the click method:

You may also pass options:

$page->click('#button', options: ['clickCount' => 2]);

But the method signature for click is the following:

 /**
     * Click the link with the given text.
     */
    public function click(string $text): self
    {
        $this->guessLocator($text)->click();

        return $this;
    }

Are the docs or the method signature wrong? From everything I can tell, the click method doesn't accept an options argument.

actengage avatar Sep 23 '25 03:09 actengage

As far as I can tell, the options were introduced in https://github.com/pestphp/pest-plugin-browser/commit/eaee826f312e2f631df51831f9e6dcf78c2a1f4f and removed in https://github.com/pestphp/pest-plugin-browser/commit/23e28909342810e5be1c65eec018996ba5400c4a.

Maybe @nunomaduro will explain the reasoning behind it in https://github.com/pestphp/pest-plugin-browser/pull/184#issuecomment-3485252914. I currently have some test cases that rely on/need the force option. I know that it is somehow an antipattern, but the implementation over at https://carbondesignsystem.com/components/checkbox/code/ forces me (pun intended) to check the underlying (hidden) checkbox that way.

riddla avatar Nov 04 '25 11:11 riddla