我在Qunit中创建了几个测试。是否可以自动运行测试?
答案 0 :(得分:1)
我认为你可以这样试试
<script type="text/javascript">
var tests = [
{ page: "Page01.htm", title: "Test Page 01 - click me to view test page" },
{ page: "Page02.htm" },
{ page: "Page01.htm" }
];
var seq = true; // false to run tests simultaneously
var runerDne = function(failures, total) {
// get notified when runner completes
}
QUnit.run(tests, seq, runerDne);
自动加载3页并相应地执行。希望这会对你有所帮助。