How can you reset / restore localstorage using Cucumber/BDD
I am writing a HTML5 / Backbone.js application which will store data using localstorage. I would like to BDD this application using Cucumber, but can't figure how to reset localstorage between tests, and in particular setup certain data before certain tests.
The only way I can do this is to maintain several Firefox profiles, each with their own state of local storage, and use these profiles dependent on what tests to run, but this seems quite brittle, complex and slow.
this should help you problem :
describe 'Favourites View ', -> beforeEach -> localStorage.clear()