我重新开始我的回答问题的相关问题。
所以我设置量角器和黄瓜框架。
我试图启动测试,但我得到的错误信息:
E /发射器 - BUG:退出发射1个其余任务
- 量角器protractor.conf.js输出
C:\obw\IVO_Workspace\mui-cpin-lb-spa\i\Cucumber>protractor protractor.conf.js
(node:11656) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmp
dir() instead.
[11:33:00] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[11:33:00] I/launcher - Running 1 instances of WebDriver
[11:33:02] E/launcher - BUG: launcher exited with 1 tasks remaining
C:\obw\IVO_Workspace\mui-cpin-lb-spa\i\Cucumber>
- webdriver的经理开始输出
这是当我发起的CLI量角器protractor.conf.js文件命令的webdriver的输出:
C:\obw\IVO_Workspace\mui-cpin-lb-spa>webdriver-manager start
[11:30:43] I/start - java -Dwebdriver.chrome.driver=C:\obw\usr\npm\node_modules\
protractor\node_modules\webdriver-manager\selenium\chromedriver_2.26.exe -Dwebdr
iver.gecko.driver=C:\obw\usr\npm\node_modules\protractor\node_modules\webdriver-
manager\selenium\geckodriver-v0.11.1.exe -jar C:\obw\usr\npm\node_modules\protra
ctor\node_modules\webdriver-manager\selenium\selenium-server-standalone-2.53.1.j
ar -port 4444
[11:30:43] I/start - seleniumProcess.pid: 10372
11:30:44.197 INFO - Launching a standalone Selenium Server
11:30:44.291 INFO - Java: IBM Corporation 2.6
11:30:44.291 INFO - OS: Windows 7 6.1 amd64
11:30:44.291 INFO - v2.53.1, with Core v2.53.1. Built from revision a36b8b1
11:30:44.338 INFO - Driver class not found: com.opera.core.systems.OperaDriver
11:30:44.338 INFO - Driver provider com.opera.core.systems.OperaDriver is not re
gistered
11:30:44.353 INFO - Driver provider org.openqa.selenium.safari.SafariDriver regi
stration is skipped:
registration capabilities Capabilities [{platform=MAC, browserName=safari, versi
on=}] does not match the current platform VISTA
11:30:44.353 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUni
tDriver
11:30:44.353 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver
is not registered
11:30:44.369 INFO - Version Jetty/5.1.x
11:30:44.385 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
11:30:44.385 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:30:44.385 INFO - Started HttpContext[/,/]
11:30:44.525 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@b744f8
a0
11:30:44.525 INFO - Started HttpContext[/wd,/wd]
11:30:44.541 INFO - Started SocketListener on 0.0.0.0:4444
11:30:44.541 INFO - Started org.openqa.jetty.jetty.Server@cd61407
11:30:44.541 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
1:4444/wd/hub
11:30:44.541 INFO - Selenium Server is up and running
11:33:00.662 INFO - Executing: [new session: Capabilities [{count=1, browserName
=chrome}]])
11:33:00.678 INFO - Creating a new session for Capabilities [{count=1, browserNa
me=chrome}]
Starting ChromeDriver 2.26.436362 (5476ec6bf7ccbada1734a0cdec7d570bb042aa30) on
port 16569
Only local connections are allowed.
11:33:02.223 INFO - Done: [new session: Capabilities [{count=1, browserName=chro
me}]]
11:33:02.235 INFO - Executing: [set script timeout: 500000])
11:33:02.241 INFO - Done: [set script timeout: 500000]
这里是启动量角器后的webdriver输出。
- protractor.conf.js文件内容
有关量角器推出configuration.js文件的这一内容:
// protractor.conf.js
exports.config = {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
getPageTimeout: 60000,
allScriptsTimeout: 500000,
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities: {
'browserName': 'chrome'
},
// Spec patterns are relative to this directory.
specs: [
'features/*.feature'
],
baseURL: 'http://localhost:8080/',
cucumberOpts: {
require: 'features/step_definitions/my_step_definitions.js',
tags: false,
format: 'pretty',
profile: false,
'no-source': true
}
};
- Test.feature文件内容
特征文件的内容:
Feature: Running Cucumber with Protractor
As a user of Protractor
I should be able to use Cucumber
to run my E2E tests
Scenario: Wrapping WebDriver
Given I go on "index.html"
Then the title should equal "My AngularJS App"
- 步骤定义文件内容
//http://chaijs.com/
var chai = require('chai');
//https://github.com/domenic/chai-as-promised/
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
module.exports = function() {
this.Given(/^I go on "([^"]*)"$/, function (arg1, callback) {
// Write code here that turns the phrase above into concrete actions
browser.get('http://localhost:9001');
callback()
});
this.Then(/^the title should equal "([^"]*)"$/, function (arg1, callback) {
// Write code here that turns the phrase above into concrete actions
expect(browser.getTitle()).to.eventually.equal(arg1).and.notify(callback);
});
}
版本:
- NPM 5.3.0
- 节点8.0.0
- 量角器4.0.13
- 硒的webdriver 2.53.1
请帮助在这一个,我不知道如何解决这个问题。