2016-09-27 67 views
1

由于我硒测试结果我有结果列表如下:自硒日志与量角器使用不合格的测试

[14:49:14] I/testLogger - 

[14:49:14] I/launcher - 0 instance(s) of WebDriver still running 
[14:49:14] I/launcher - chrome #01-0 passed 
[14:49:14] I/launcher - chrome #01-1 failed 4 test(s) 
[14:49:14] I/launcher - chrome #01-2 passed 
[14:49:14] I/launcher - chrome #01-3 failed 1 test(s) 
[14:49:14] I/launcher - chrome #01-4 passed 
[14:49:14] I/launcher - chrome #01-5 passed 
[14:49:14] I/launcher - chrome #01-6 passed 
[14:49:14] I/launcher - chrome #01-7 passed 
[14:49:14] I/launcher - chrome #01-8 passed 
[14:49:14] I/launcher - chrome #01-9 passed 
[14:49:14] I/launcher - chrome #01-10 failed 7 test(s) 
[14:49:14] I/launcher - chrome #01-11 failed 5 test(s) 
[14:49:14] I/launcher - chrome #01-12 failed 5 test(s) 
[14:49:14] I/launcher - chrome #01-13 passed 
[14:49:14] I/launcher - chrome #01-14 passed 
[14:49:14] I/launcher - overall: 22 failed spec(s) 
[14:49:14] E/launcher - Process exited with error code 1 

是否有可能与像例如适用的一些更详细的信息自定义此列表失败的测试添加规格名称?现在我必须滚动我的控制台才能匹配浏览器实例,并且规范失败。

+0

你使用什么测试框架?即茉莉花,摩卡等 – Gunderson

+0

我正在使用茉莉花。 Gunderson的答案可能会解决我的问题。在测试Jasmin Spec Reporter后,我会保存你的信息 – magneto

回答

2

如果您使用茉莉花,那么您可以使用一些记者选项。看看Jasmine Spec Reporter,它很容易设置。您通过NPM安装后,只要求它在你的配置文件,添加一个简单的功能你onPrepare(),即:

// conf.js 
var SpecReporter = require('jasmine-spec-reporter'); 
exports.config = { 
    onPrepare: function() { 
     jasmine.getEnv().addReporter(new SpecReporter({ 
      displayStacktrace: 'true', 
      displaySpecDuration: 'true' 
     })); 
    }; 
}; 

如果这是你正在寻找没有什么,可以有一些其他的记者,人们已经取得了,或者你总是可以自己创建一个custom jasmine reporter

1

我有大量的测试/验证,我将所有结果转储到CSV然后在Excel中打开它。一旦数据在Excel中,您就可以使用Excel的全部功能来过滤数据,添加数据透视表等,以便根据需要查看数据。

你只需要定义你关心的列。对于你的例子,你可能从测试名称,浏览器,结果,???开始。一旦这是在Excel中,你插入>表,然后通过结果=失败过滤。现在你可以看到所有失败的测试。您还可以创建数据透视表来显示运行摘要。

我创建了一个自定义Excel VBA宏,该宏导入CSV,将数据转换为表格,并为我自动创建一个数据透视表。我几乎每天都会使用它,我无法想象以任何其他方式进行。