私は、ブラウザ機能を使ってうまくいくAngular2 E2Eテストケースで、分度器+ジャスミンを使用する予定ですが、実際にヘッドレスブラウザが必要です。私が知っているように、PhantomJSはHeadlessを使用するための1つのオプションです。しかし、私は実際に分度器をどのようにconfileするのか分かりません。現在、私の分度器のconfファイルはangular2 E2Eテストケースを持つ分度器+ジャスミン
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter')
exports.config = {
allScriptsTimeout: 11000,
specs: [
'../e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome',
/*browserName: 'phantomjs',
version: '',
platform: 'ANY'*/
},
directConnect: true,
baseUrl: 'http://localhost:8080/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
useAllAngular2AppRoots: true,
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
}
}
がどのようにブラウザを開くことなくPhantomJSを設定するには、以下のように見ていますか?私はこれが配備のためにすべてのCDCI PIPEラインで最も有用だと思います。
これを追加します:私は以下のコードをphantomJSに追加しました。
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
> [email protected] pree2e /Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app
> webdriver-manager update
selenium standalone is up to date.
chromedriver is up to date.
> [email protected] e2e /Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app
> protractor "config/protractor.conf.js"
[16:49:27] E/launcher - Process exited with error code 1
/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/built/driverProviders/direct.js:39
throw new Error('browserName (' + this.config_.capabilities.browserName +
^
Error: browserName (phantomjs) is not supported with directConnect.
at Direct.setupEnv (/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/built/driverProviders/direct.js:39:23)
at Runner.run (/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/built/runner.js:252:37)
at TaskRunner.run (/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/built/taskRunner.js:108:27)
at createNextTaskRunner (/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/built/launcher.js:208:28)
at /Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/built/launcher.js:235:13
at _fulfilled (/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/node_modules/q/q.js:796:13)
at /Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/node_modules/q/q.js:604:44
at runSingle (/Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/node_modules/protractor/node_modules/q/q.js:137:13)
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "e2e" "--" "config/protractor.conf.js"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] e2e: `protractor "config/protractor.conf.js"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] e2e script 'protractor "config/protractor.conf.js"'.
npm ERR! This is most likely a problem with the recoveries-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! protractor "config/protractor.conf.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs recoveries-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls recoveries-app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/nai628/BalaRequiredfiles/AngularCLIPOC/RecoveryProjectWorkSpaceUpdate_v1/customer-servicing-service/recoveries-app/npm-debug.log
Some end-to-end tests failed, see above.
上記の追加:私は以下のように追加しようとしています: –
'エラー:browserName(phantomjs)はdirectConnectでサポートされていません。 Direct.setupEnvで。あなたの設定から 'directConnect'を削除してください。 – Gunderson
@Gunderson私は答えとしてそれを置くべきだと思います。ありがとう。 – alecxe