vendredi 29 avril 2016

CasperJs do something before start?

I use JWTs to manage logged-in status, so I need to clear localstorage before running casper.start. How is this possible?

Something like:

casper.then(function() {
  casper.evaluate(function() {
    localStorage.clear()
  })
})

casper.start('http://localhost:3000', function() {
  test.assertUrlMatch('http://localhost:3000')
})

Aucun commentaire:

Enregistrer un commentaire