dtby67541 2015-07-26 14:36
浏览 43
已采纳

Behat / Mink没有找到“Then”语句的默认步骤

I cannot get Mink/Behat to find the default step for the phrase

Then I should see "some text" in the element "element"

Here is my thepage.feature file:

Feature: Page Works
  In order to use the page
  As a visitor
  I need to be able to load it and see content

Scenario: Navigating to the page
  Given I am on "mypage.php"
  #Then I should see "some text"
  #Then the "body" element should contain "sometext"
  #Then I should see "sometext" in the "body" element

My FeatureContext extends MinkContext so I don't see why the lower two Then statements come up as undefined, but the upper one works.

  Scenario: Navigating to the page        # features\wikipedia.feature:6
    Given I am on "thepage.php"           # FeatureContext::visit()
    Then I should see "sometext" in the element "body"

1 scenario (1 undefined)
2 steps (1 undefined)

Since the Given statement works, I don't understand what could be wrong! Surely it can't be the yml file or composer.json?

composer.json:

{
    "require": {
        "behat/behat": "2.4.*@stable",
        "behat/mink": "1.4.*@stable",
        "behat/mink-extension": "*",
        "behat/mink-goutte-driver": "*",
        "behat/mink-selenium2-driver": "*"
    },
    "minimum-stability": "dev",
    "config": {
        "bin-dir": "bin/"
    }
}

behat.yml:

default:
  extensions:
    Behat\MinkExtension\Extension:
      base_url: http://localhost
      goutte: ~
      selenium2: ~

Where else could the problem be? Thanks

  • 写回答

2条回答 默认 最新

  • dsgdsf12312 2015-07-26 17:30
    关注

    Try to use

    Then I should see "sometext" in the "body" element
    

    instead of

    Then I should see "sometext" in the element "body"
    

    Here is MinkContext method description

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?