【发布时间】:2016-04-18 18:12:19
【问题描述】:
我正在尝试配置 gulp 以启动 Protractor(和 webdriver),但我得到了 "[launcher] Error: ReferenceError: System is not defined" 。我之前将 Karma 设置为识别 System,但我不知道如何为 Protractor 做同样的事情。
这是我的 protractor.conf.js
exports.config = {
framework: 'jasmine',
specs: ['./dist/**/*e2e.js'],
// seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
seleniumServerJar: './node_modules/selenium-standalone-jar/bin/selenium-server-standalone-2.45.0.jar'
// seleniumServerJar: './node_modules/selenium/selenium-standalone-jar/bin/selenium-server-standalone-2.48.2.jar'
}
我的 gulp 任务(gulpfile.js):
gulp.task('e2e', function(callback) {
gulp
.src(['./dist/**/*e2e.js'])
.pipe(angularProtractor({
'configFile': 'protractor.conf.js',
'debug': true,
'autoStartStopServer': true
}))
.on('error', function(e) {
console.log(e);
})
.on('end', callback);
});
和量角器相关(package.json)
"gulp-protractor": "^2.1.0",
"protractor": "2.5.1",
"selenium-standalone-jar": "2.45.0",
任何建议都非常感谢!
【问题讨论】:
-
是的,我明白了......我没有看到任何解决方案,但......
-
有没有人有量角器和角度 2 的简单工作示例?我想我尝试了 git 中的所有示例,并且我能够实际运行测试只是 github.com/mgechev/angular2-seed 这对我来说非常复杂。我尝试的所有其他示例都出现相同的错误。
标签: angular karma-jasmine gulp-protractor