PhantomJS not persisting localStorage consistently

前端 未结 1 1592
生来不讨喜
生来不讨喜 2021-01-20 04:55

I am trying to make an isolated test case to experiment with PhantomJS localStorage behavior, but in my testCase, localStorage does not appear to be persistent.

相关标签:
1条回答
  • 2021-01-20 05:55

    It may be timing-related. If you exit phantom too quickly the changes to localStorage may not be persisted. Changing phantom.exit() to setTimeout(phantom.exit, 1500) seemed to work.

    0 讨论(0)
提交回复
热议问题