1

So i'm working with casperjs and i have this weird problem...

casper.test.begin('Login Page Behaviour', function suite(test) {

    login(); //casper.start(URLLOGIN, function() {...}) works fine

    casper.thenOpen(URLBASE, function() {
        test.assert(false, 'message');
    });

    casper.thenOpen(URLBASE, function() {
        test.assert(true, 'message');
    });

    logout(); //casper.thenOpen(URLLOGOUT); works fine too.

    casper.run(function() {
        test.done();
    });
});

this code works fine. i have first test that fail and second that works. But if i add a wait function in first test:

casper.thenOpen(URLBASE, function() {
    casper.wait(1000, function() {
       test.assert(false, 'message')
    })
});

suddenly the script stop after the first test (if it fail, it doesn't if it pass).

Did I miss something about wait()?

thanks for helping.

Bertos
  • 63
  • 1
  • 8
  • Interesting, this has probably something to do how exceptions are bubbled. – Artjom B. Oct 22 '14 at 15:06
  • [Here](https://gist.github.com/artjomb/294e40d58a20238d8da8) I did some tests that should show most of the different use cases and how it behaves. – Artjom B. Oct 22 '14 at 15:43
  • Thanks! i will take an instant look at this! – Bertos Oct 22 '14 at 15:45
  • So only the third one works? That's weird... i really don't understand why. but thank you for those tests! i will try to use it. – Bertos Oct 22 '14 at 16:03

0 Answers0