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.
誰がこの問題に直面していますか?私が紛失している大きな変化はありますか?
「フレームワーク」に設定した内容を表示してください。 – alecxe
@alex何も面白くない、私の設定ファイルを追加しました。また、私はいくつかのロケータが欠けていたが、これを失敗させるべきではないことを知っているグローバルな名前空間をチェックしています。私にチェックさせてください! –