Skip to content

Instantly share code, notes, and snippets.

@n1k0
Created June 18, 2012 12:00
Show Gist options
  • Save n1k0/2948039 to your computer and use it in GitHub Desktop.
Save n1k0/2948039 to your computer and use it in GitHub Desktop.
casperjs test --includes
casper.echo('plop');
casper.start('http://google.com/', function() {
this.test.assertTitle('Google');
});
casper.run(function() {
this.test.done();
});

Invokation:

$ casperjs --includes=included_script.js test main_test_script.js

Output:

Test file: main_test_script.js                                                                 
plop
PASS Page title is "Google"
PASS 1 tests executed, 1 passed, 0 failed.    
@danpalmer
Copy link

If I use "includes=foo.js" casper tells me that it can't find that file. Using '--includes' doesn't give me that problem, but the echo never seems to happen.

@danpalmer
Copy link

I have reproduced the problem with this gist exactly how it is. I had to add '--' to 'includes', but it still didn't work.

@n1k0
Copy link
Author

n1k0 commented Jun 18, 2012

What casper/phantom versions are you using? Which platform?

Edit: sorry, it's --includes=, I updated the gist

@danpalmer
Copy link

I'm using CasperJS v0.6.10 and PhantomJS v1.5.0, which is what brew installed for me a few days ago. I'm using Mac OS Lion.

@n1k0
Copy link
Author

n1k0 commented Jun 18, 2012 via email

@danpalmer
Copy link

Tried this: casperjs --includes=pwd/included_script.js test main_test_script.js and with typing out the whole path, neither work. The test script runs, just no output from the included script. This is really weird.

@n1k0
Copy link
Author

n1k0 commented Jun 18, 2012

Could you please try to switch to latest master? lots of fixes happened recently, while I don't see any reason for your issue being covered, it's maybe worth the effort…

@danpalmer
Copy link

Brilliant, all works on master. Thanks so much for your help!

@n1k0
Copy link
Author

n1k0 commented Jun 18, 2012

I'm glad if I helped :)

Now I'm still wondering why it didn't work by your side using 0.6.10 :$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment