2

To be able to test my web service, I need to be logged in.

I've wrote a casperjs test for the login funcionality, but I would like to reuse that in all of my future tests.

Is there a way to modularize the login routine I've already wrote, and have it to run at each test's start function?

jviotti
  • 17,881
  • 26
  • 89
  • 148
  • duplicate of http://stackoverflow.com/questions/15138761/how-to-write-own-casperjs-modules ? – eis May 06 '13 at 18:25

1 Answers1

0

You can either write a module or extend the casper object.

In a test context, this gist may be useful as well.

NiKo
  • 11,215
  • 6
  • 46
  • 56