我是量角器的初学者。我做了运行量角器所需的安装。当尝试运行量角器文档中提到的示例脚本时,我收到 ETIMEDOUT 错误。并且 url 指向 127.0.0.1:4444。同样的 url 也不能手动访问。但是当尝试http://localhost:4444/wd/hub时,页面会正确打开。我不确定为什么 conf.js 试图访问 127.0.0.1:4444,即使我将“seleniumAddress”参数提供给“ http://localhost:4444/wd/hub ”。请帮我解决这个问题
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['todo-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);
});
});