格式错误的字段路径“”(InvalidArgumentException)

H H*_*H H 3 php automated-tests behat mink goutte

我正在使用Behat进行一些自动化测试,并且已将Mink和其Goutte驱动程序添加在一起。我正在使用最新版本的Behat and Mink。

我已经将Mink扩展添加到Feature Context文件中,并且当我运行一个简单的功能时它可以工作:

Feature:...
  Scenario: See A Blog Post
    Given I am on the homepage
    And I follow "login"
    Then I should be on "/login"
    And I should see "Login"
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试下一步并尝试填写一些字段时:

    And I fill in "username" with "admin"
Run Code Online (Sandbox Code Playgroud)

用户名:

<input class="input-field" type="text" id="username"/>

我收到以下错误:

Malformed field path "" (InvalidArgumentException)
Run Code Online (Sandbox Code Playgroud)

任何帮助都感激不尽,

谢谢!

Ros*_*man 5

这是因为您name="username"的字段上没有属性。我有一个类似的问题,但是我正在尝试测试一个没有名称属性的Stripe实例。它出现idtitle但不起作用。