zenstruck / browser

A fluent interface for your Symfony functional tests.
MIT License
185 stars 17 forks source link

Allow selectFieldOptions to deselect all values #142

Closed notFloran closed 6 months ago

notFloran commented 6 months ago

I have a select multiple and in one of my test I need to unselect all values, I try ->selectFieldOption('Réparateur(s)', []) without result.

The method selectFieldOptions use a foreach and theselectFieldOption of Mink and so do nothing when I pass an empty array.

After some digging, I found that Mink use the following syntax to do that : ->page()->fillField($selector, []); (see https://github.com/minkphp/Mink/issues/374#issuecomment-83586667).

kbond commented 6 months ago

Nice addition @notFloran! I made some tweaks to get the Panther tests passing and merged your commit in #143 (I didn't have permission to update your fork's branch).

notFloran commented 6 months ago

Nice addition @notFloran! I made some tweaks to get the Panther tests passing and merged your commit in #143 (I didn't have permission to update your fork's branch).

Oh thanks ! I was unable to correct the Panther part.