Open mockdeep opened 5 months ago
Okay, I was trying to figure out where that "1000 ms" was coming from, and realized you set it inside your code. So I can't really control that. Not sure if it will do any good, but I might try navigating to a blank page at the beginning of each test to make sure about:blank
can load quickly.
Welp, that didn't work either. It looks like the timeout was added in #315, but it's not clear to me why it was needed.
Following up on this. I put an ugly hack in our code to prevent axe-core from changing the timeout, and we haven't seen one of these errors in nearly a month.
config.before(:each, type: :system) do
page.driver.browser.manage.timeouts.instance_eval do
def page_load=(*)
# no-op don't want axe-core changing this
end
end
end
@AdnoC looks like you introduced the timeout. Do you have any suggestions on how to proceed with this?
We encountered the same problem (getting flaky CI tests where we use be_axe_clean, resulting in Selenium::WebDriver::Error::TimeoutError
) with our feature specs and @mockdeep s solution worked (thank you!), but, as mentioned by them, did not feel very good 🙂 our current work-around is, to not use the be_axe_clean matcher directly after a page reload, but rather after another expectation. This also feels less than optimal, but works for now 🤷
For what it's worth, we still run our axe checks after an assertion to ensure that the page is fully loaded. I'm not sure if there's a way for axe-core
to automatically detect that the page is settled. I suppose it could at least check that the page is fully loaded, but it would still have a hard time detecting whether there is any other JavaScript behavior on the page.
At any rate, we still see this issue, even with an assertion to ensure that the page is fully loaded.
Describe the bug
We occasionally get test flake on CI with
Selenium::WebDriver::Error::TimeoutError
. It looks like Selenium is timing out when trying to getabout:blank
insidewithin_about_blank_context
. I'm going to see if I can increase the timeout, since right now it's only 1 second, but I'm wondering if this is something that should be handled somehow inside of the gem.Environment Happening In
To Reproduce
I don't have a great way to reproduce it, unfortunately. Basically, you need to run it lots of times on CI (we run it on every button or link click). One thing to note is that it only seems to happen very early in the test, like on the login page. We do have assertions to ensure that our page is fully loaded before running
be_axe_clean
. Here is the error and stack trace:Expected behavior
Consistently executing accessibility checks.
Actual behavior
Something like 5-10% of builds fail due to one of the tests getting this timeout.
Screenshots
n/a
Related Tickets
n/a
Desktop: