From 97673ae30baa68be7d8d26e96bc8481ba73b65fc Mon Sep 17 00:00:00 2001 From: W0rma Date: Tue, 9 Dec 2025 14:44:50 +0100 Subject: [PATCH] Fix type error for element without form --- src/Codeception/Lib/InnerBrowser.php | 4 ++-- tests/data/app/view/form/field_values.php | 1 + tests/unit/Codeception/Module/TestsForWeb.php | 21 ++++++++++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php index dc11858..22dd243 100644 --- a/src/Codeception/Lib/InnerBrowser.php +++ b/src/Codeception/Lib/InnerBrowser.php @@ -802,7 +802,7 @@ protected function getValueAndTextFromField(Crawler $nodes): array|string return $values; } - $this->fail("Element {$nodes} is not a form field or does not contain a form field"); + $this->fail("Element {$nodes->getNode(0)?->getNodePath()} is not a form field or does not contain a form field"); } /** @@ -1539,7 +1539,7 @@ public function grabValueFrom($field): mixed return $values; } - $this->fail("Element {$nodes} is not a form field or does not contain a form field"); + $this->fail("Element {$nodes->getNode(0)?->getNodePath()} is not a form field or does not contain a form field"); } public function setCookie($name, $val, $params = []) diff --git a/tests/data/app/view/form/field_values.php b/tests/data/app/view/form/field_values.php index 8c99c29..df89ba3 100644 --- a/tests/data/app/view/form/field_values.php +++ b/tests/data/app/view/form/field_values.php @@ -54,5 +54,6 @@ +