量角器测试不具有测试和断言输出,而仅具有规范 [英] Protractor test doesn't have test and assertion output and instead just has spec
本文介绍了量角器测试不具有测试和断言输出,而仅具有规范的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在量角器网站上的此处 https://angular.github. io/protractor/#/
I'm trying to do the tutorial on the Protractor website here https://angular.github.io/protractor/#/
但是,我的输出未按预期包含1 test, 3 assertions, 0 failures
.
However, my output does not include 1 test, 3 assertions, 0 failures
as expected.
相反,它是:
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Started
.
1 spec, 0 failures
Finished in 12.273 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
配置文件:
Config file:
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);
});
});
版本:
Versions:
- 节点4.2.4
- NPM 3.5.3
- 量角器3.0.0
推荐答案
我发现此问题是由于量角器的最新版本v3.0.0引起的.
I've discovered that this issue is because of the latest version of protractor, v3.0.0.
我安装了v2.5.1,现在我得到的是x test, x assertion, x failures
而不是x specs, x failures
.
I installed v2.5.1 and I get x test, x assertion, x failures
instead of x specs, x failures
now.
这篇关于量角器测试不具有测试和断言输出,而仅具有规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文