我正在使用量角器黄瓜, 首先,没有黄瓜我成功地运行测试,但我很快通过NPM添加黄瓜支持,我得到的结果与未定义的测试,见下文:没有结果从黄瓜量角器运行
1 scenario (1 undefined)
3 steps (3 undefined)
0m00.000s
[15:04:58] I/launcher - 0 instance(s) of WebDriver still running
[15:04:58] I/launcher - chrome #01 passed
Process finished with exit code 0
这意味着chromeDriver开始后几秒钟关闭, 我已经尝试过了两个项目,一个是混帐: https://github.com/eis95/CucumberProtractorExample
所以你可以看到我是如何定义的配置,也是packages.js文件, 包文件:
{
"name": "uiautomation-v2.0",
"version": "0.0.0",
"description": "UIAutomationV2.0",
"main": "app.js",
"author": {
"name": "Eyal.Cohen"
},
"devDependencies": {
"cucumber": "^2.3.1",
"protractor-cucumber-framework": "^3.1.2"
},
"dependencies": {
"@types/jasmine": "^2.5.53",
"protractor": "latest"
}
}
And the conf.js file:
exports.config = {
specs: ['features/**/*.feature'],
//seleniumServerJar:'./node_modules/protractor/selenium/selenium-server-standalone-2.52.0.jar',
//chromeDriver: './node_modules/protractor/selenium/chromedriver_2.21',
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
cucumberOpts: {
tags: [],
require: ['features/step_definitions/newGameSteps.js'], //'features/specSetup.js','features/**/step_definitions/**/*Steps.js'
format: 'pretty'
}
};
规格:
defineSupportCode(function({Given, When, Then}) {
Given(/^Navigate to studio url$/, function(callback) {
//callback(null, 'pending');
navigationSteps.navigateToStudio(data.server).then(function() {
loginPage.userName.isDisplyed();
})
callback();
});
When(/^Login with username and pass$/, function(callback) {
navigationSteps.loginToStudio(data.username, data.password).then(function() {
navigationSteps.navigateUrl(data.server + '/studio/#/sxp?isautomation=true').then(function() {
})
callback();
});
});
Then(/^Welcome page is displayed$/, function(callback) {
sxpSteps.sendSxp(testData.requestNewTaskSxp).then(function() {
navigationSteps.navigateToUrl(data.server + '/studio/#/schedule').then(callback)
});
callback();
});
});
根据您提供的信息的东西感谢您的帮助 感谢
你能提供完整的记录和你的步实施?现在看起来它会在控制台中输出一个缺失的场景。如果你有一个步骤文件,这应该表示它找不到它/代码不正确。最后一个问题,你为什么用量角器和CucumberJS这样的旧版本?这可能会给浏览器和支持带来问题。量角器已经在5.1.2和CucumberJS已经在1.3.3/2.3.1 – wswebcreation
我已经更新量角器和黄瓜,但package.js没有更新它是正确的?我想念什么? ,只需卸载使用NPM和安装量角器:NPM安装量角器....对不对? – user1937902
我加入了SEPC代码 - 看到后 – user1937902