lib/r2-oas/schema/editor.rb in r2-oas-0.3.2 vs lib/r2-oas/schema/editor.rb in r2-oas-0.3.3
- old
+ new
@@ -112,10 +112,17 @@
def open_browser_and_set_schema
capabilities = { 'chromeOptions' => { 'w3c' => false } }
@browser ||= Watir::Browser.new(:chrome, capabilities)
@browser.goto(url)
if wait_for_loaded
- @browser.driver.local_storage[storage_key] = @schema_doc_from_local
+ # MEMO:
+ # Because it may not be updated
+ # Make sure that the launched local storage is updated reliably
+ Watir::Wait.until do
+ old_storage = @browser.driver.local_storage[storage_key].dup
+ @browser.driver.local_storage[storage_key] = new_storage = @schema_doc_from_local
+ old_storage != new_storage
+ end
@browser.refresh
end
end
def wait_for_loaded