詹金斯 + qUnit [英] Jenkins + qUnit

查看:19
本文介绍了詹金斯 + qUnit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何轻松地将 Jenkins 与 qUnit 集成?我将使用真正的浏览器(如 firefox 和 chrome)来运行测试.我的服务器在 RedHat 6.1 Linux 上运行.我想我有所有需要的插件/库,但我仍然不知道如何让它工作.我第一次使用 Jenkins(在服务器端).

How to easily integrate Jenkins with qUnit? I gonna use real browser (like firefox and chrome) to run tests. My server runs on RedHat 6.1 Linux. I think I have all needed plugins/libraries but I still don't know how to make it working. I'm working with Jenkins 1st time (on server side).

//

如果有人也可以分享如何构建覆盖率报告的想法,那就太好了.

It would be wonderful if someone can share idea how to build coverage report too.

提前致谢:).

推荐答案

说 Jenkins 和 QUnit 只是难题的一部分.您仍然需要一个 Web 浏览器和一种从 QUnit 结果到磁盘上获取 JUnit 样式 XML 文件的方法.虽然有用于控制众多浏览器的 Selenium 和 Webdriver,但最简单的入门方法是使用 PhantomJS (http://phantomjs.org/).PhantomJS 是一个基于 webkit 的无头浏览器,仅用于此类任务.

Saying Jenkins and QUnit is only part of the puzzle. You still need a web browser and a way to get a JUnit style XML file from the QUnit results on to disk. While there is Selenium and Webdriver for controlling numerous browsers, the easiest way to get started is to use PhantomJS (http://phantomjs.org/). PhantomJS is a headless webkit based browser meant just for tasks like this.

如果您浏览此页面的测试框架"部分(http://code.google.com/p/phantomjs/wiki/WhoUsesPhantomJS )你会看到几个运行 QUnit 的脚本(一些支持 JSCoverage).phantomjs-jscoverage-qunit 脚本看起来会击中您想要击中的所有要点,United 也是如此.两者看起来都需要一些摆弄才能让他们继续前进.

If you browse the "Test Frameworks" sections of this page ( http://code.google.com/p/phantomjs/wiki/WhoUsesPhantomJS ) you will see several scripts for running QUnit (some with JSCoverage support). The phantomjs-jscoverage-qunit script looks like it will hit all the major points you want to hit, as does United. Both look like they will require some fiddling to get them going though.

唉,我还没有发现任何方法可以运行 QUnit 测试并为 Selenium、WebDriver 或 PhantomJS 获取 JUnit 输出,无需修改即可工作.

Alas, I haven't discovered any method for running QUnit tests and getting JUnit output for either Selenium, WebDriver, or PhantomJS that will just work without modification.

现在几个月后,我很清楚 webdriver 是 Selenium 的未来(当时我可能应该很清楚,但事实并非如此).此外,PhantomJS 现在通过 GhostDriver 与 WebDriver 一起使用,因此仅支持 WebDriver 并选择 PhantomJS 作为目标可能是未来的最佳建议.

Now several months later, it have become clear to me that webdriver is the future of Selenium (it probably should have been clear to me back then, but it wasn't). Also, PhantomJS now works with WebDriver via GhostDriver, so supporting only WebDriver and choosing PhantomJS as a target is probably the best advice going forward.

这篇关于詹金斯 + qUnit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆