Skip to content

Commit a2833e1

Browse files
dbjorgestraker
authored andcommitted
test: add workaround for target-size test failure in Firefox 131 nightly (#4557)
Refs: #4556
1 parent 72e269f commit a2833e1

File tree

1 file changed

+33
-28
lines changed

1 file changed

+33
-28
lines changed

test/integration/rules/runner.js

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -110,34 +110,39 @@
110110
before(done => {
111111
fixture.innerHTML = testObj.content;
112112
waitForFrames(fixture, () => {
113-
axe.run(
114-
fixture,
115-
{
116-
/**
117-
* The debug flag helps log errors in a fairly detailed fashion,
118-
* when tests fail in webdriver
119-
*/
120-
debug: true,
121-
performanceTimer: false,
122-
runOnly: { type: 'rule', values: [ruleId] }
123-
},
124-
(err, r) => {
125-
// assert that there are no errors - if error exists a stack trace is logged.
126-
const errStack = err && err.stack ? err.stack : '';
127-
assert.isNull(err, 'Error should be null. ' + errStack);
128-
// assert that result is defined
129-
assert.isDefined(r, 'Results are defined.');
130-
// assert that result has certain keys
131-
assert.hasAnyKeys(r, ['incomplete', 'violations', 'passes']);
132-
// assert incomplete(s) does not have error
133-
r.incomplete.forEach(incomplete => {
134-
assert.isUndefined(incomplete.error);
135-
});
136-
// flatten results
137-
results = flattenResult(r);
138-
done();
139-
}
140-
);
113+
// The setTimeout is a workaround for a Firefox bug. See:
114+
// - https://github.com/dequelabs/axe-core/issues/4556
115+
// - https://bugzilla.mozilla.org/show_bug.cgi?id=1912115
116+
setTimeout(() => {
117+
axe.run(
118+
fixture,
119+
{
120+
/**
121+
* The debug flag helps log errors in a fairly detailed fashion,
122+
* when tests fail in webdriver
123+
*/
124+
debug: true,
125+
performanceTimer: false,
126+
runOnly: { type: 'rule', values: [ruleId] }
127+
},
128+
(err, r) => {
129+
// assert that there are no errors - if error exists a stack trace is logged.
130+
const errStack = err && err.stack ? err.stack : '';
131+
assert.isNull(err, 'Error should be null. ' + errStack);
132+
// assert that result is defined
133+
assert.isDefined(r, 'Results are defined.');
134+
// assert that result has certain keys
135+
assert.hasAnyKeys(r, ['incomplete', 'violations', 'passes']);
136+
// assert incomplete(s) does not have error
137+
r.incomplete.forEach(incomplete => {
138+
assert.isUndefined(incomplete.error);
139+
});
140+
// flatten results
141+
results = flattenResult(r);
142+
done();
143+
}
144+
);
145+
}, 0);
141146
});
142147
});
143148
runTest(testObj, 'passes');

0 commit comments

Comments
 (0)