我们正在运行带有Selenium Grid的Protractor,(现在)有2个浏览器。当测试失败时,我发现它们失败了,我看到每个浏览器上有多少测试失败,但不知何故我无法看到测试失败的浏览器。 这是Selenium还是Protractor的缺点还是我做错了什么?
答案 0 :(得分:0)
将这些添加到onprepare块中的protractor.conf.js中,如下所示。
onPrepare: function () {
// The require statement must be down here, since jasmine-reporters
// needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmine.ConsoleReporter());
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: 'reports/screenshots' ,
takeScreenShotsOnlyForFailedSpecs: true
}));
},
一定要使用jasmine-reporter~0.4.0,1.0.0还没有使用量角器,因为它适用于较新的茉莉花版本,然后是量角器直到现在使用。