我是Protractor的新手。我从Command Pallette(Ctrl-Shift-P
或F1
)运行它时遇到问题。我正在使用:VS Code 1.11.2和Protractor 5.1.1。
protractor protractor/protractor.conf.js
**you must either specify a configuration file or at least 3 options. See below for the options:...
文件夹结构
..demo
....package.json
....node_modules
....protractor
........protractor.conf.js
........spec.js
protractor.conf.js
exports.config = {
framework: 'jasmine',
capabilities: {
browserName: 'chrome'
},
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['protractor_selenium.js']
};
spec.js
describe("google show", function(){
it('should work', function(){
browser.ignoreSynchronization = true;
browser.get('https://google.com');
//does somethi
browser.ignoreSynchronization = false;
});
});
launch.js
{
"version": "0.2.0",
{
"type": "node",
"request": "launch",
"name": "Protractor Tests",
"args": ["${workspaceRoot}/protractor/protractor.conf.js"],
"program": "${workspaceRoot}/node_modules/protractor/bin/protractor/"
},
{
"type": "node",
"request": "attach",
"name": "Attach to Port",
"address": "localhost",
"port": 5858
}
]
}
答案 0 :(得分:1)
这不是Visual Studio Code或ProtractorJS功能,这是由第三方插件(https://marketplace.visualstudio.com/items?itemName=luciannaie.protractor-test-runner)实现的。尝试在github上找到作者 - https://github.com/lnaie/vscode-protractor-test-runner/issues/