正在使用serenity-bdd,日志分析很重要。但是在日志中存在很多垃圾信息。
Serenety在日志中使用了大量的asci art,这在我看来是浪费空间,并产生了很多噪音。
end2endtests | _____ _____ ____ _____ ____ _____ _ ____ _____ _____ ____
end2endtests | |_ _| ____/ ___|_ _| / ___|_ _|/ \ | _ \_ _| ____| _ \
end2endtests | | | | _| \___ \ | | \___ \ | | / _ \ | |_) || | | _| | | | |
end2endtests | | | | |___ ___) || | ___) || |/ ___ \| _ < | | | |___| |_| |
end2endtests | |_| |_____|____/ |_| |____/ |_/_/ \_\_| \_\|_| |_____|____/
end2endtests |
end2endtests |
然后在最后,我们得到的。
end2endtests | __ _____ _____ ____ _____ ____ _ ____ ____ _____ ____
end2endtests | _ \ \ |_ _| ____/ ___|_ _| | _ \ / \ / ___|/ ___|| ____| _ \
end2endtests | (_)_____| | | | | _| \___ \ | | | |_) / _ \ \___ \\___ \| _| | | | |
end2endtests | _|_____| | | | | |___ ___) || | | __/ ___ \ ___) |___) | |___| |_| |
end2endtests | (_) | | |_| |_____|____/ |_| |_| /_/ \_\____/|____/|_____|____/
end2endtests | /_/
end2endtests |
end2endtests | TEST PASSED
我们在Jenkins服务器上通过一个Maven命令来做这个,我真的很想减少这种噪音,这样我们就能减少一点记录和噪音。我一直在寻找它,但没有找到一个明确的答案,给我的见解。
你需要通过 -Dserenity.console.headings=minimal
或 -Dserenity.console.headings=normal
或在命令行中使用
或者在命令行中使用
System.SetProperty("serenity.console.headings", "normal");
详见下文
你可以在serenity.properties文件中使用以下属性来关闭报告中的日志记录。(Serenity modelcore版本:2.2.5)
serenity.console.headings=none 关闭 TEST STARTED 横幅, serenity.console.banner=none 关闭 SERENITY BDD 横幅。
参考资料:Serenity.console.banner=none,关闭SERENITY BDD横幅。https:/www.javadoc.iodocnet.serenity-bddserenity-modellatestnetthucydidescoreThucydidesSystemProperty.html