Skip to content

Commit

Permalink
tests: enable previously skipped tests in ie11 (#2716)
Browse files Browse the repository at this point in the history
* tests: enable previously skipped tests in ie11

* log error

* try again

* increase timeout

* error?

* getting closer

* try a knewer conversion

* wav file

* found issue, cannot fix

* comment

* put back

* next batch

* final set

* should be it
  • Loading branch information
straker authored Jan 4, 2021
1 parent ce9917e commit a08dc02
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 67 deletions.
8 changes: 6 additions & 2 deletions test/checks/media/no-autoplay-audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ describe('no-autoplay-audio', function() {
var preloadOptions = { preload: { assets: ['media'] } };

before(function() {
// The tests actually pass in IE10/11 in Windows machine, but fails in IE in selenium-ie-driver
// Issue has been created to debug selenium ie failing tests
// our circle ci windows machine cannot play audio elements
// (mp3 nor wav formats). setting an onerror event handler
// resulted in error code 4: MEDIA_ERR_SRC_NOT_SUPPORTED.
// looking around it might be due to a setting in ie11 that
// prevents audio from playing
// @see https://stackoverflow.com/questions/34802319/audio-tag-is-not-working-in-ie11/41172831
if (isIE11) {
this.skip();
}
Expand Down
41 changes: 19 additions & 22 deletions test/commons/dom/url-props-from-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,28 +80,25 @@ describe('dom.urlPropsFromAttribute', function() {
assert.deepEqual(actual, expected);
});

(isIE11 ? it.skip : it)(
'returns URL properties for `A` with `HREF` (having FTP protocol)',
function() {
var vNode = queryFixture(
'<a id="target" href="ftp://mywebsite.org">Navigate to My Website</a>'
);
var expected = {
filename: '',
hash: '',
hostname: 'mywebsite.org',
pathname: '/',
port: '',
protocol: 'ftp:',
search: {}
};
var actual = axe.commons.dom.urlPropsFromAttribute(
vNode.actualNode,
'href'
);
assert.deepEqual(actual, expected);
}
);
it('returns URL properties for `A` with `HREF` (having FTP protocol)', function() {
var vNode = queryFixture(
'<a id="target" href="ftp://mywebsite.org">Navigate to My Website</a>'
);
var expected = {
filename: '',
hash: '',
hostname: 'mywebsite.org',
pathname: '/',
port: isIE11 ? '21' : '',
protocol: 'ftp:',
search: {}
};
var actual = axe.commons.dom.urlPropsFromAttribute(
vNode.actualNode,
'href'
);
assert.deepEqual(actual, expected);
});

it('returns URL properties for `A` with `HREF` which has subdirectory and inline link', function() {
var vNode = queryFixture(
Expand Down
8 changes: 6 additions & 2 deletions test/core/utils/preload-media.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ describe('axe.utils.preloadMedia', function() {
var isIE11 = axe.testUtils.isIE11;

before(function() {
// The tests actually pass in IE10/11 in Windows machine, but fails in IE in selenium-ie-driver
// Issue has been created to debug selenium ie failing tests
// our circle ci windows machine cannot play audio elements
// (mp3 nor wav formats). setting an onerror event handler
// resulted in error code 4: MEDIA_ERR_SRC_NOT_SUPPORTED.
// looking around it might be due to a setting in ie11 that
// prevents audio from playing
// @see https://stackoverflow.com/questions/34802319/audio-tag-is-not-working-in-ie11/41172831
if (isIE11) {
this.skip();
}
Expand Down
63 changes: 29 additions & 34 deletions test/integration/full/css-orientation-lock/violations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('css-orientation-lock violations test', function() {
'use strict';

var shadowSupported = axe.testUtils.shadowSupport.v1;
var isIE11 = axe.testUtils.isIE11;

var styleSheets = [
{
Expand Down Expand Up @@ -33,43 +32,39 @@ describe('css-orientation-lock violations test', function() {
});
}

// This currently breaks in IE11
(isIE11 ? it.skip : it)(
'returns VIOLATIONS if preload is set to TRUE',
function(done) {
// the sheets included in the html, have styles for transform and rotate, hence the violation
axe.run(
{
runOnly: {
type: 'rule',
values: ['css-orientation-lock']
}
},
function(err, res) {
assert.isNull(err);
assert.isDefined(res);
it('returns VIOLATIONS if preload is set to TRUE', function(done) {
// the sheets included in the html, have styles for transform and rotate, hence the violation
axe.run(
{
runOnly: {
type: 'rule',
values: ['css-orientation-lock']
}
},
function(err, res) {
assert.isNull(err);
assert.isDefined(res);

// check for violation
assert.property(res, 'violations');
assert.lengthOf(res.violations, 1);
// check for violation
assert.property(res, 'violations');
assert.lengthOf(res.violations, 1);

// assert the node
var checkedNode = res.violations[0].nodes[0];
assert.isTrue(/html/i.test(checkedNode.html));
// assert the node
var checkedNode = res.violations[0].nodes[0];
assert.isTrue(/html/i.test(checkedNode.html));

// assert the relatedNodes
var checkResult = checkedNode.all[0];
assert.lengthOf(checkResult.relatedNodes, 2);
assertViolatedSelectors(checkResult.relatedNodes, [
'.someDiv',
'.thatDiv'
]);
// assert the relatedNodes
var checkResult = checkedNode.all[0];
assert.lengthOf(checkResult.relatedNodes, 2);
assertViolatedSelectors(checkResult.relatedNodes, [
'.someDiv',
'.thatDiv'
]);

done();
}
);
}
);
done();
}
);
});

(shadowSupported ? it : xit)(
'returns VIOLATIONS whilst also accommodating shadowDOM styles',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
describe('landmark-banner-is-top-level test pass', function() {
'use strict';
var results;
var isIE11 = axe.testUtils.isIE11;

before(function(done) {
axe.testUtils.awaitNestedLoad(function() {
Expand All @@ -23,8 +22,7 @@ describe('landmark-banner-is-top-level test pass', function() {
});

describe('passes', function() {
// This currently breaks in IE11
(isIE11 ? it.skip : it)('should find 3', function() {
it('should find 3', function() {
assert.lengthOf(results.passes[0].nodes, 2);
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
describe('landmark-contentinfo-is-top-level test pass', function() {
'use strict';
var results;
var isIE11 = axe.testUtils.isIE11;
before(function(done) {
axe.testUtils.awaitNestedLoad(function() {
axe.run(
Expand All @@ -27,8 +26,7 @@ describe('landmark-contentinfo-is-top-level test pass', function() {
});

describe('passes', function() {
// This currently breaks in IE11
(isIE11 ? it.skip : it)('should find 2', function() {
it('should find 2', function() {
assert.lengthOf(results.passes[0].nodes, 2);
});
});
Expand Down
4 changes: 3 additions & 1 deletion test/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
window.addEventListener('load', function() {
axe.run(document, function(err, res) {
console.log(res.violations);
res.incomplete.forEach(issue => console.log(issue));
res.incomplete.forEach(function(issue) {
console.log(issue);
});
});
});
</script>
Expand Down

0 comments on commit a08dc02

Please sign in to comment.