2016-07-20 1 views
1

우리는, 나는 다음과 같은 오류가 4.0 각도기로 업그레이드 이후 config 파일 -'전역'이 각도기 4.0.0에서 예상대로 작동하지 않습니까?

exports.config = { 

directConnect: true, 
baseUrl: env.baseUrl, 
capabilities: env.capabilities, 

onPrepare: function() { 
var chai = require('chai'); 
var chaiAsPromised = require('chai-as-promised'); 
chai.use(chaiAsPromised); 
global.expect = chai.expect; // by removing this line error is not thrown 
browser.manage().window().maximize(); 
}, 

setDefaultTimeout : 60 * 1000, 
framework: 'custom', 
frameworkPath: require.resolve('protractor-cucumber-framework'), 
specs: [ 
'../Features/*.feature' 
], 

cucumberOpts: { 
monochrome: true, 
strict: true, 
plugin: ["pretty"], 
require: ['../StepDefinitions/*.js', '../Support/*.js'], 
tags:'@AddActiveTip,@AddInActiveTip,[email protected],[email protected]' 
//tags:'@TestSplitText' 
} 
}; 

우리의 onPrepare 기능에 다음과 같은 설정을 얻고있는 브라우저가 무기한 중단하고 오류가 어쨌든에서 디버깅하는 데 도움이되지 않습니다 .

오류 :

> protractor Config/config.js --troubleshoot 

[22:38:12] I/direct - Using FirefoxDriver directly... 
[22:38:12] I/launcher - Running 1 instances of WebDriver 
/Users/pasalar/protractor/psms-protractor/node_modules/protractor/built/exitCodes.js:87 
      if (e.message.indexOf(errMsg) !== -1) { 
         ^
TypeError: Cannot read property 'indexOf' of undefined 
at Function.ErrorHandler.isError (/Users/pasalar/protractor/psms-protractor/node_modules/protractor/built/exitCodes.js:87:30) 
at Function.ErrorHandler.parseError (/Users/pasalar/protractor/psms-protractor/node_modules/protractor/built/exitCodes.js:98:26) 
at process.<anonymous> (/Users/pasalar/protractor/psms-protractor/node_modules/protractor/built/launcher.js:169:54) 
at emitOne (events.js:82:20) 
at process.emit (events.js:169:7) 
at process.emit (/Users/pasalar/protractor/psms-protractor/node_modules/protractor/node_modules/source-map-support/source-map-support.js:419:21) 
at process._fatalException (node.js:224:26) 
npm ERR! Test failed. See above for more details. 

다른 사람이이 문제에 직면하고있다? 내가 놓친 중대한 변경 사항이 있습니까?

+0

'프레임 워크'에 대해 설정 한 내용을 보여 주시겠습니까? – alecxe

+0

@alex 너무 화려하지 않고, 설정 파일을 추가했습니다. 또한 나는 일부 로케이터가 빠졌음에도 불구하고 이것이 실패하지 않도록해야한다는 것을 알고있는 전역 네임 스페이스를 확인하고있다. 내가 체크해 볼게! –

답변

1

표시된 오류 메시지는 "globals"과 아무런 관련이 없습니다. 예상대로 작동합니다! 내 스크립트는 네트워크 대기 시간 문제로 인해 무작위로 실패했습니다. 그러나 사용자가 오류의 원인을 알지 못하기 때문에 오류 메시지가 개선되어야합니다!

이 문제를 디버그 할 수 있었기 때문에 표시가 닫혔습니다.

관련 문제