简体   繁体   中英

Qunit is it possible to run tests automatically?

I created several tests in Qunit. Is it possible to run the test automatically ?

I think you can try this way

<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);

This loads 3 pages automatically and executes accordingly. Hope this helps you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM