Codeception / Codeception/lib-innerbrowser

InnerBrowser fillField throws exception if input does not have a name attribute

未关闭
#24 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
87
派生
20
PR 合并指标
30 天内没有已合并 PR

描述

This issue comes from the problem reported in Codeception/Codeception#1221. You will get an exception with the text `InvalidArgumentException: Malformed field path ""` if you call `fillField` for a form field without a name attribute or an empty name attribute.

This comes from the fact that the call to `matchFormField` at https://github.com/Codeception/Codeception/blob/2.1/src/Codeception/Lib/InnerBrowser.php#L789 uses the value of the name attribute to access the fields in a `\Symfony\Component\DomCrawler\Form` object.

However, this `Form` object will not store form fields that do not have a value for their name attribute, see this line of code: https://github.com/symfony/dom-crawler/blob/master/Form.php#L452.

I don't see an easy workaround for this problem, but maybe someone else does, maybe @Naktibalda or @DavertMik? I am not really familiar with this part of the Codeception codebase :)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。