Closed tysonnero closed 10 years ago
Unless I am unclear, I don't believe this is supported.
"The casperjs test command will treat every passed argument as file or directory paths containing tests. It will recursively scan any passed directory to search for .js or .coffee files and add them to the stack." - http://docs.casperjs.org/en/latest/testing.html
That is what the docs say... but
I'm running version 1.1.0 and am passing in cli arguments to my tests. Here's an example command: casperjs test tests.js --port=3000
In my test, I can use casper.cli.get('port') to get the value '3000'.
Ah ha...
http://docs.casperjs.org/en/latest/testing.html#options "Options are prefixed with a double-dash (--)"
I think that's the key for passing in custom args.
Options are indeed supported and use a prefix of -- I just added additional support for an "args" array in the grunt task configuration. Arguments can still be injected via the CLI as well..
Ability to pass options via args
has been lost in 0.3.6. Could you please restore it?
It's still there, https://github.com/iamchrismiller/grunt-casper/blob/master/tasks/lib/casper.js#L118
Along with the test , https://github.com/iamchrismiller/grunt-casper/blob/master/Gruntfile.js#L72
What issues are you running into?
Forgot to add I was using args
with test: true
. I know it's not officially supported, but it's very useful for passing phantomjs options (such as --ignore-ssl-errors
when testing via HTTPS with self-signed certificates) and generally making tests more configurable
Can you enable support for passing arguments for tests as CasperJS supports this?