iamchrismiller / grunt-casper

Run CasperJS Scripts/Functional Tests
Other
69 stars 38 forks source link

missed test files randomly #65

Closed ttback closed 9 years ago

ttback commented 9 years ago

I am trying to run all the .js files under smoke dir with grunt-casper, but sometimes it runs only 2 of the js files

grunt-casper config:

casper : {
         smoke : {
            options : {
              test : true,
              "fail-fast": true,
              "log-level": "info",
              "verbose": true,
              "parallel": false,
            },
            files : {
              './smoke/casper-results.xml' : ['test/smoke/*.js']
            }
          }
        }

Test code (the files share the same code to test out grunt-casper) I can't see anything wrong with it atm. I don't think it's related to the request to url, since the "running test" message is not even output for the missing test.

casper.test.begin(" test", 1, function(test) {
    casper.start();

    console.log("running test);
    casper.open(url, {
        method: 'head'
    });

    casper.then(function(response) {
        test.done();
    });

    casper.run(function() {
        casper.exit();
    });
});
lgiraudel commented 9 years ago

Try to replace casper.exit() by casper.test.done()

ttback commented 9 years ago

@lgiraudel thanks, that worked