HuddleEng / PhantomFlow

Describe and visualise user flows through tests with PhantomJS
MIT License
682 stars 60 forks source link

Passing data into tests #17

Closed rdooh closed 8 years ago

rdooh commented 9 years ago

This is awesome by the way...

I'm successfully running this inside an Express app. My aim is to integrate this into a small local service for testing and retesting various sites. Some of those sites require u:p credentials to log in. Although I can hardcode them into the tests (with casper.setHttpAuth()), I'd rather be able to pass these in from the outside. Possible to do something like '--flowargs=...' or similar? Essentially, I need to get something user-supplied from the node/Express app req.params into the individual tests... is this possible in the current setup, or a possible enhancement?

Many thanks, Rob

jamescryer commented 9 years ago

Passing arbitrary parameters from the NodeJS scope into the PhantomJS scope is not currently supported. But this sounds like a good feature request.

If you've got the time, I'd appreciate a Pull Request. Otherwise, I'll take a look next week.

rdooh commented 9 years ago

Sure - I wound up doing something kinda janky, but worked for what I needed. I'll aim to spend a little time on it in a few days to try to generalize it and fire it back your way to consider.

jamescryer commented 8 years ago

casperArgs (string[]): optional arguments to pass into casper and PhantomJS, such as --ignore-ssl-errors=true