2016-07-22 5 views
-1

Angular2 E2E 테스트 케이스와 함께 각도기 + 재스민을 사용할 계획입니다. 브라우저 기능을 사용하면 문제가 없지만 실제로는 헤드리스 브라우저를 사용해야합니다. 필자가 아는 것처럼 PhantomJS는 Headless를 사용하는 하나의 옵션입니다. 그러나 저는 분도사를 어떻게 편성해야 할 지 잘 모릅니다. 현재 나의 각도기 회의 파일은 다음과 같습니다.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. 
+0

위의 추가 : 나는 아래와 같이 추가하려고합니다 : –

+1

'오류 : browserName (phantomjs)은 directConnect에서 지원되지 않습니다. Direct.setupEnv'에서. 당신의 설정에서'directConnect'를 제거하십시오. – Gunderson

+1

@ Gunderson 당신은 답으로 써야한다고 생각합니다. 감사. – alecxe

답변

1

Error: browserName (phantomjs) is not supported with directConnect. at Direct.setupEnv : 나는 NG E2E를 사용하여 각도기를 실행 한

capabilities: { 

    //'browserName': 'chrome', 
    browserName: 'phantomjs', 
    'phantomjs.binary.path': 'dist/vendor/phantomjs/bin/phantomjs', 
    'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG'] 

    }, 

, 나는 아래의 오류를 얻고있다.

구성에서 directConnect을 제거해야합니다. 이 옵션은 Chrome 및 Firefox에서만 지원됩니다. 자세한 내용은 master configserver setup 문서를 확인하십시오.

+0

많은 분들께서 귀하의 추천에 따라 문제가 해결되었습니다. confc 파일에서 directConnect에 주석을 달고 Phantomjs를 글로벌 방식으로 설치했습니다. –

+0

@BalakrishnaTirumalasetti 아무런 문제가 없으므로 도움이 되니 기쁩니다. 이 문서를 참조하십시오 : http://stackoverflow.com/help/someone-answers – Gunderson

관련 문제