Skip to content

Commit

Permalink
test: add workaround for target-size test failure in Firefox 131 nigh…
Browse files Browse the repository at this point in the history
…tly (#4557)

Refs: #4556
  • Loading branch information
dbjorge authored Aug 7, 2024
1 parent cfd2974 commit 4d8c87e
Showing 1 changed file with 33 additions and 28 deletions.
61 changes: 33 additions & 28 deletions test/integration/rules/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,39 @@
before(done => {
fixture.innerHTML = testObj.content;
waitForFrames(fixture, () => {
axe.run(
fixture,
{
/**
* The debug flag helps log errors in a fairly detailed fashion,
* when tests fail in webdriver
*/
debug: true,
performanceTimer: false,
runOnly: { type: 'rule', values: [ruleId] }
},
(err, r) => {
// assert that there are no errors - if error exists a stack trace is logged.
const errStack = err && err.stack ? err.stack : '';
assert.isNull(err, 'Error should be null. ' + errStack);
// assert that result is defined
assert.isDefined(r, 'Results are defined.');
// assert that result has certain keys
assert.hasAnyKeys(r, ['incomplete', 'violations', 'passes']);
// assert incomplete(s) does not have error
r.incomplete.forEach(incomplete => {
assert.isUndefined(incomplete.error);
});
// flatten results
results = flattenResult(r);
done();
}
);
// The setTimeout is a workaround for a Firefox bug. See:
// - https://github.com/dequelabs/axe-core/issues/4556
// - https://bugzilla.mozilla.org/show_bug.cgi?id=1912115
setTimeout(() => {
axe.run(
fixture,
{
/**
* The debug flag helps log errors in a fairly detailed fashion,
* when tests fail in webdriver
*/
debug: true,
performanceTimer: false,
runOnly: { type: 'rule', values: [ruleId] }
},
(err, r) => {
// assert that there are no errors - if error exists a stack trace is logged.
const errStack = err && err.stack ? err.stack : '';
assert.isNull(err, 'Error should be null. ' + errStack);
// assert that result is defined
assert.isDefined(r, 'Results are defined.');
// assert that result has certain keys
assert.hasAnyKeys(r, ['incomplete', 'violations', 'passes']);
// assert incomplete(s) does not have error
r.incomplete.forEach(incomplete => {
assert.isUndefined(incomplete.error);
});
// flatten results
results = flattenResult(r);
done();
}
);
}, 0);
});
});
runTest(testObj, 'passes');
Expand Down

0 comments on commit 4d8c87e

Please sign in to comment.