我实际上是在尝试配置量角器和黄瓜来运行测试,实际上它们似乎被启动了好几次。这是我的命令的结果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'
你知道他们为什么要发射几次吗?