I am getting an error with my spinach tests (Ruby on Rails). Every test fails for the same reason:
<unknown>: Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs.
(Session info: chrome=46.0.2490.86)
(Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Mac OS X 10.10.5 x86_64)
Example failing test step from Spinach:
step 'I visit the site' do
visit "/top?DEBUG_USER=#{$spinach_test_userid}"
page.execute_script('localStorage.clear()') # clear localStorage and reload to act as fresh login
visit "/top?DEBUG_USER=#{$spinach_test_userid}"
end
Ideas?
Set-up includes RSpec, Capybara, Spinach, Chromedriver, Selenium. Code includes Mongo, Node.js, Rails...
UPDATE: Realized that the tests were not set up to run the app before running the test, so it was trying to find local storage without having correctly visited the page first ('page not found'). Running app manually in a separate terminal tab solved the problem. Leaving this question up for next n00b who needs help. ;-)
The problem is that you're trying to delete the local storage data before you're actually navigating to a URL.
Your browser page actually looks like in the screenshot here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With