用量角器和黄瓜进行了几次测试

时间:2015-07-30 06:39:24

标签: cucumber protractor cucumberjs

我实际上是在尝试配置量角器和黄瓜来运行测试,实际上它们似乎已经多次启动了。这是我的命令NODE_ENV=test protractor test/protractor.conf.coffee

的结果
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.1.14:36187/wd/hub

Feature:

  Scenario:                                   # test/integration/features/001-i-can-see-brands.feature:7
    When I open the uri "#/"                  # test/integration/features/001-i-can-see-brands.feature:5
    Then I should be on the uri "#/brand"     # test/integration/features/001-i-can-see-brands.feature:8
    And I should see several css "brand-card" # test/integration/features/001-i-can-see-brands.feature:9
    And I should see several css "brand-card" # test/integration/features/001-i-can-see-brands.feature:9
    Then I should be on the uri "#/brand"     # test/integration/features/001-i-can-see-brands.feature:8


1 scenario (1 passed)
5 steps (5 passed)


1 scenario (1 passed)
5 steps (5 passed)
2 scenarios (2 passed)
5 steps (5 passed)


1 scenario (1 passed)
5 steps (5 passed)
2 scenarios (2 passed)
5 steps (5 passed)
3 scenarios (3 passed)
5 steps (5 passed)
    When I open the uri "#/"                  # test/integration/features/001-i-can-see-brands.feature:5
UnknownError: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'HP-Z230', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.19.0-25-generic', java.version: '1.7.0_79'
Driver info: driver.version: EventFiringWebDriver

这是功能

Feature:

  Background:
    When  I open the uri "#/"

  Scenario:
    Then  I should be on the uri "#/brand"
    And   I should see several css "brand-card"

这是我的protractor.conf.coffee

exports.config =
  baseUrl: 'http://localhost:3102'
  seleniumServerJar: '../node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar'
  framework: 'cucumber'
  multiCapabilities: [
    # {
    #   browserName: 'phantomjs'
    #   'phantomjs.binary.path': require('phantomjs').path
    #   'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG']
    # }
    { browserName: 'chrome' }
  ]
  specs: [
    'integration/features/*.feature'
  ]
  cucumberOpts:
    require: 'integration/steps/*.coffee'
    format: 'pretty'

你知道他们为什么要多次推出吗?

1 个答案:

答案 0 :(得分:0)

我找到了答案:cucumberjs版本0.5.2是错误的。通过将版本修复为0.5.1

解决了这个问题