Skip to content

Instantly share code, notes, and snippets.

@indirect
Created September 28, 2013 03:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indirect/6738064 to your computer and use it in GitHub Desktop.
Save indirect/6738064 to your computer and use it in GitHub Desktop.
Iterate over an array creating CasperJS steps for each element
casper = require('casper').create()
casper.start 'http://docs.casperjs.org/en/latest/', ->
createWeekStep = (weekNum, index, weeks) ->
@then -> console.log("running step for week #{weekNum}")
(i for i in [1..12]).forEach(createWeekStep, @)
casper.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment