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 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助