gpt4 book ai didi

angularjs - E/configParser - 错误消息 : configuration file cli. js 未导出配置对象

转载 作者:太空宇宙 更新时间:2023-11-04 01:47:42 25 4
gpt4 key购买 nike

我是 Protractor 新手,我在 eclipse 中成功设置了 Protractor 。我按照这个 https://www.protractortest.org/#/链接,其中conf.js包含:

exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['todo-spec.js']
};

并且spec.js包含:

describe('angularjs homepage todo list', function() {
it('should add a todo', function() {
browser.get('https://angularjs.org');

element(by.model('todoList.todoText')).sendKeys('write first protractor test');
element(by.css('[value="add"]')).click();

var todoList = element.all(by.repeater('todo in todoList.todos'));
expect(todoList.count()).toEqual(3);
expect(todoList.get(2).getText()).toEqual('write first protractor test');

// You wrote your first test, cross it off the list
todoList.get(2).element(by.css('input')).click();
var completedAmount = element.all(by.css('.done-true'));
expect(completedAmount.count()).toEqual(2);
});
});

链接中提到的代码。但是当我执行conf.js时,它在eclipse的控制台中显示以下错误。

[10:31:25] E/configParser - Error code: 105

[10:31:25] E/configParser - Error message: configuration file D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\protractor\built\cli.js did not export a config object

[10:31:25] E/configParser - Error: configuration file D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\protractor\built\cli.js did not export a config object

at ConfigParser.addFileConfig (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\protractor\built\configParser.js:141:19)
at Object.initFn [as init] (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\protractor\built\launcher.js:93:22)
at Object.<anonymous> (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\protractor\built\cli.js:225:10)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)

请提出建议。

最佳答案

以下是我的运行配置,适用于我的 Eclipse。

1) 主选项卡 test 是我的项目文件夹

enter image description here

2) Protractor 选项卡 enter image description here

我安装了Angularjs Eclipse 1.2,无法选择自己安装的Nodejs,我必须使用Angularjs Eclipse 1.2中嵌入的Nodejs,但是这个低版本无法满足我的Protractor,因此我将高版本的node.exe复制到嵌入Nodejs安装文件夹中以覆盖较低的node.exe。之后一切都按预期顺利进行

一些Google搜索说Angularjs Eclipse 1.3可以修复无法选择自行安装的Nodejs,但我没有运气将其安装在我的Eclipse java Luna和Eclipse jee Luna上。

关于angularjs - E/configParser - 错误消息 : configuration file cli. js 未导出配置对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50850299/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com