Protractor - empty local storage

前端 未结 5 762
臣服心动
臣服心动 2020-12-03 13:30

I\'m using Protractor (with Jasmine) to test my AngulaJs application.

As result of some of my action I get some data saved in the localStorage. Now I need to test ot

5条回答
  •  情深已故
    2020-12-03 13:54

    If there's still a problem with the localStorage when executing a "removeItem()", you can use a try-catch, like:

    browser.executeScript("try {localStorage.removeItem('access_token');} catch(exception) {}");
    

提交回复
热议问题