我正在使用 JUnit4,并希望在 JUnit 报告中显示一些额外的信息。为此,我将把额外信息转储到报告 xml,然后修改 xslt 以读取该额外信息以生成 HTML 报告。
到目前为止有效的步骤是:
我的junit ant任务:
<junit fork="yes" printsummary="withOutAndErr">
<!--<formatter type="xml"/>-->
<formatter classname="com.some.junit.MyFormatter" extension=".xml"/>
<test name="com.some.source.MyTestClassTest" todir="${junit.output.dir}"/>
<classpath refid="JUnitProject.classpath"/>
</junit>
Run Code Online (Sandbox Code Playgroud)
我修改后的蚂蚁报告任务:
<target name="junitreport" depends="MyTestClassTest">
<junitreport todir="${junit.output.dir}">
<fileset dir="${junit.output.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report styledir="reportstyle" format="frames" todir="${junit.output.dir}"/>
</junitreport>
</target>
Run Code Online (Sandbox Code Playgroud)
我遇到过使用 TestNG 或 SureFire Maven 插件作为解决方案,但我无法在我的项目中使用它们。
JUnit4中有比这更好的方法吗?
我观察到 CSS 文件没有被缓存在 Chrome 浏览器上。我的应用程序由 Angular-CLI 构建,所有必需的缓存控制标头和 Expires 标头设置为 5 分钟:
Accept-Ranges:bytes
Cache-Control:max-age=600
Content-Encoding:gzip
Content-Type:text/css
Date:Wed, 13 Sep 2017 05:11:17 GMT
ETag:W/"441246-1505278984000"
Expires:Wed, 13 Sep 2017 05:21:18 GMT
Last-Modified:Wed, 13 Sep 2017 05:03:04 GMT
Server:Apache-Coyote/1.1
Transfer-Encoding:chunked
Vary:Accept-Encoding
Run Code Online (Sandbox Code Playgroud)
使用相同响应头设置的 JS 文件按预期缓存。.css 文件也缓存在 Firefox Mozilla 中。我搜索了帖子,几乎没有帖子建议是:
如果出现任何 SSL 错误,Chrome 有时不会缓存提供自签名证书和使用 HTTPS 的资源。但就我而言,所有其他文件(如 .js、.png 文件)都在同一频道上运行并被缓存。
将Transfer-Encoding: chunked导致在缓存上镀铬的任何问题?不过它在 FireFox 中运行良好。
gzip 压缩不适用于 Chrome:https : //github.com/expressjs/compression/issues/64
任何指示/建议?
我正在尝试将量角器与Jenkins结合使用.在我的jenkins中,我需要动态生成URL.
因此,在运行量角器测试时,例如:
describe('angularjs homepage', function() {
it('should greet the named user', function() {
// Load the AngularJS homepage.
browser.get('http://www.angularjs.org');
element(by.model('yourName')).sendKeys('testUser');
});
});
Run Code Online (Sandbox Code Playgroud)
在上面的例子中,我想动态地传递一个变量来代替" http://www.angularjs.org ".
我找不到任何可以在参考配置中指定的变量.