We use DocuSign at Bosltr to facilitate electronic signatures and testing this functionality with Cucumber has proved to be quite a pain. First of all DocuSign uses an iframe to deliver its functionality so there was that added complexity right off the bat. Secondly, because we’re doing integration testing, I wanted to actually hit the DocuSign test servers and verify that things are still working as I expect. Stubbing the requests out wouldn’t give me insight into any unexpected API changes breaking our app. Because we’re reaching out externally I had to account for the delay in receiving data from DocuSign often needing to revert to ugly things like
sleep 3 in the step definitions.
The rest of this post assumes you already have Poltergeist installed.
features/support/env.rb add the following hooks:
1 2 3 4 5 6 7 8
…which I actually have in my
Spork.each_run do block
Now by default any stories tagged with just
@docusign. Perhaps naming the tag
@selenium would be more appropriate, but I only plan to use Selenium for testing DocuSign stories so this works for me for now. Note: I’m not sure why the
@javacript sets up more than just the driver, but if anyone has more of an explanation I’d love to know.
In an effort to help other devs perhaps more quickly acceptance test DocuSign with Cucumber here are the step definitions that I came up with for our use case.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62