dequelabs / axe-core-gems

Ruby integration for axe-core, the accessibility testing engine
https://deque.com/axe
Mozilla Public License 2.0
86 stars 29 forks source link

fix: Safari noSuchWindowException and Page/Frame not ready #385

Closed scottmries closed 5 months ago

scottmries commented 6 months ago

QA Notes:

The following code occasionally caused Safari to throw a noSuchWindowException around 1 in 10 times, and I expect it never to do so now.

require "selenium-webdriver"
require_relative "../../lib/axe/api/run"
require "json"

driver = Selenium::WebDriver.for :safari
# driver.navigate.to "http://google.com"
driver.navigate.to "https://dequeuniversity.com/demo/mars/"

res = Axe::Core.new(driver).call Axe::API::Run.new.with_options

puts JSON.pretty_generate res.results.to_h

driver.quit

Note the commented # driver.navigate to "http://google.com". Issue #353 notes that attempting to navigate to http://google.com would also occasionally cause an exception "Page/Frame not ready" to be thrown; it should no longer do so.

Please uncomment this line, comment driver.navigate.to "https://dequeuniversity.com/demo/mars/" and test again. This fix is included here since they are closely related.

Closes: #352 Closes: #353