From bb15c0317f47a7a515daace718fcd51ae2a18cba Mon Sep 17 00:00:00 2001 From: John Ferlito Date: Sun, 15 May 2022 11:46:05 +1000 Subject: [PATCH] matchOption: fix for broken up select Without this I wasn't getting matches on ```html --- src/Codeception/Lib/InnerBrowser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php index 71e008b..26a7abd 100644 --- a/src/Codeception/Lib/InnerBrowser.php +++ b/src/Codeception/Lib/InnerBrowser.php @@ -1241,7 +1241,7 @@ protected function matchOption(Crawler $field, string|array $option) $option = $option['text']; } - $options = $field->filterXPath(sprintf('//option[text()=normalize-space("%s")]|//input[@type="radio" and @value=normalize-space("%s")]', $option, $option)); + $options = $field->filterXPath(sprintf('//option[normalize-space(text())=normalize-space("%s")]|//input[@type="radio" and @value=normalize-space("%s")]', $option, $option)); if ($options->count() !== 0) { $firstMatchingDomNode = $options->getNode(0); if ($firstMatchingDomNode->tagName === 'option') {