尝试禁用或删除 Cucumber 测试的本地存储。
我尝试了以下方法:
page.driver.execute_script("localStorage.clear()")
但我收到以下错误
One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).
SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
at phantomjs://webpage.evaluate():1
at phantomjs://webpage.evaluate():1
at phantomjs://webpage.evaluate():1
at phantomjs://webpage.evaluate():1 (Capybara::Poltergeist::JavascriptError)