如何查看哪个浏览器带有带有selenium网格的Protractor

时间:2014-08-11 06:44:25

标签: protractor selenium-grid

我们正在运行带有Selenium Grid的Protractor,(现在)有2个浏览器。当测试失败时,我发现它们失败了,我看到每个浏览器上有多少测试失败,但不知何故我无法看到测试失败的浏览器。 这是Selenium还是Protractor的缺点还是我做错了什么?

1 个答案:

答案 0 :(得分:0)

你使用茉莉花记者吗?我发现控制台在错误源自哪个浏览器中表明足够清楚。当然,HTML报告非常清楚。

将这些添加到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还没有使用量角器,因为它适用于较新的茉莉花版本,然后是量角器直到现在使用。