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.

Any ideas?

Answers


this should help you problem :

describe 'Favourites View ', ->
  beforeEach ->
    localStorage.clear()

Need Your Help

Javascript: How to hide a div which is dynamically created?

javascript jquery html css

I'm creating a div dynamically using the following code:

Oracle xlmtype how to extract

xml oracle xmltype

I know there were a lot of questions about it but I did not manage to solve problem on my example. I have xlmtype column in my oracle database: