【发布时间】:2014-04-23 09:25:10
【问题描述】:
我假设这是可能的,实际上很简单,但我对 grunt 和 protractor 都是新手,我无法在网上找到答案(可能我使用了错误的搜索条件)。
我在文件 test/e2e/Recipients.js 中有以下 e2e 测试:
describe('Recipients Tab', function() {
beforeEach(function () {
browser.get('#/recipients');
});
it('should have no e-mail list', function () {
expect(element(by.css('accordion')).isPresent()).toBe(false);
});
});
目前,我正在这样做:
grunt e2e
我的量角器配置文件:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
specs: ['../e2e/**/*.js'],
baseUrl : 'http://localhost:8080/spr',
jasmineNodeOpts: {
showColors: true // Use colors in the command line report.
}
};
当然,这会运行我所有的测试,但在我开发特定测试时,我不想运行整个测试组。我想运行这个文件。
我该怎么做?有没有flag什么的?
谢谢
【问题讨论】:
-
你的 protractor.conf.js 是什么样的?请将其编辑为您的原始问题
-
你可以使用
specs量角器选项来传递一个逗号分隔的JS文件列表来执行。您需要编辑 Gruntfile.js 以将此选项传递给量角器 -
JB Nizet,我刚刚尝试过,它确实有效。谢谢。想写一个我可以接受的答案吗?
标签: javascript angularjs gruntjs protractor end-to-end