Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(travis): test on IE Edge #14401

Merged
merged 3 commits into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions karma-shared.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ module.exports = function(config, specificOptions) {
platform: 'Windows 8.1',
version: '11'
},
'SL_EDGE': {
base: 'SauceLabs',
browserName: 'microsoftedge',
platform: 'Windows 10',
version: '14'
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a BrowserStack entry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

'SL_iOS': {
base: 'SauceLabs',
browserName: 'iphone',
Expand Down Expand Up @@ -120,6 +126,13 @@ module.exports = function(config, specificOptions) {
os: 'Windows',
os_version: '8.1'
},
'BS_EDGE': {
base: 'BrowserStack',
browser: 'edge',
browser_version: '14',
os: 'Windows',
os_version: '10'
},
'BS_iOS_8': {
base: 'BrowserStack',
device: 'iPhone 6',
Expand Down
4 changes: 2 additions & 2 deletions scripts/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ if [ "$JOB" == "ci-checks" ]; then
grunt ci-checks
elif [ "$JOB" == "unit" ]; then
if [ "$BROWSER_PROVIDER" == "browserstack" ]; then
BROWSERS="BS_Chrome,BS_Safari,BS_Firefox,BS_IE_9,BS_IE_10,BS_IE_11,BS_iOS_8,BS_iOS_9"
BROWSERS="BS_Chrome,BS_Safari,BS_Firefox,BS_IE_9,BS_IE_10,BS_IE_11,BS_EDGE,BS_iOS_8,BS_iOS_9"
else
BROWSERS="SL_Chrome,SL_Firefox,SL_Safari_8,SL_Safari_9,SL_IE_9,SL_IE_10,SL_IE_11,SL_iOS"
BROWSERS="SL_Chrome,SL_Firefox,SL_Safari_8,SL_Safari_9,SL_IE_9,SL_IE_10,SL_IE_11,SL_EDGE,SL_iOS"
fi

grunt test:promises-aplus
Expand Down
26 changes: 22 additions & 4 deletions test/AngularSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1755,8 +1755,7 @@ describe('angular', function() {
};
}

it('should bootstrap from an extension into an extension document for same-origin documents only', function() {

describe('from extensions into extension documents', function() {
// Extension URLs are browser-specific, so we must choose a scheme that is supported by the browser to make
// sure that the URL is properly parsed.
var protocol;
Expand All @@ -1773,10 +1772,29 @@ describe('angular', function() {
protocol = 'browserext:'; // Upcoming standard scheme.
}

expect(allowAutoBootstrap(createFakeDoc({src: protocol + '//something'}, protocol))).toBe(true);
expect(allowAutoBootstrap(createFakeDoc({src: protocol + '//something-else'}, protocol))).toBe(false);

if (protocol === 'ms-browser-extension:') {
// Support: Edge 13-15
// In Edge, URLs with protocol 'ms-browser-extension:' return "null" for the origin,
// therefore it's impossible to know if a script is same-origin.
it('should not bootstrap for same-origin documents', function() {
expect(allowAutoBootstrap(createFakeDoc({src: protocol + '//something'}, protocol))).toBe(false);
});

} else {
it('should bootstrap for same-origin documents', function() {

expect(allowAutoBootstrap(createFakeDoc({src: protocol + '//something'}, protocol))).toBe(true);
});
}

it('should not bootstrap for cross-origin documents', function() {
expect(allowAutoBootstrap(createFakeDoc({src: protocol + '//something-else'}, protocol))).toBe(false);
});

});


it('should bootstrap from a script with no source (e.g. src, href or xlink:href attributes)', function() {

expect(allowAutoBootstrap(createFakeDoc({src: null}))).toBe(true);
Expand Down
2 changes: 1 addition & 1 deletion test/ng/animateRunnerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ describe('$$AnimateRunner', function() {
expect(status).toBe(true);
}));

it('should break the chian when a function evaluates to false',
it('should break the chain when a function evaluates to false',
inject(function($$rAF, $$AnimateRunner) {

var runner1 = new $$AnimateRunner();
Expand Down
96 changes: 56 additions & 40 deletions test/ng/directive/inputSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
describe('input', function() {
var helper = {}, $compile, $rootScope, $browser, $sniffer, $timeout, $q;

// UA sniffing to exclude Edge from some date input tests
var isEdge = /\bEdge\//.test(window.navigator.userAgent);

generateInputCompilerHelper(helper);

beforeEach(inject(function(_$compile_, _$rootScope_, _$browser_, _$sniffer_, _$timeout_, _$q_) {
Expand Down Expand Up @@ -688,18 +691,20 @@ describe('input', function() {
expect($rootScope.form.alias.$error.month).toBeTruthy();
});

it('should allow four or more digits in year', function() {
var inputElm = helper.compileInput('<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Narretz when you were preparing this change, were you able to determine the root cause of these inputSpec failures? I've been looking at these failures recently as part of the work @jdalton mentioned to include AngularJS tests in our Edge Regression testing. I have concluded that this line helper.changeInputValueTo('10123-03'); is failing to set the .value property on the HTML element in Edge, which is what results in the eventual failure, but I had to stop before getting to "why" the value property isn't getting set.

If there is an Edge bug behind this I'd love to make sure it gets filed.

Copy link
Contributor Author

@Narretz Narretz Apr 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AmazingJaze I assumed that Edge simply doesn't allow setting years with more than 4 digits in all the date input elements, so when you enter 10123-03 etc. the input has no value (because it's invalid) and we don't get a value to work with. But I haven't actually checked if this is the Edge bug.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is indeed the case that Edge does not support dates with years past 9999.

The spec does explicitly allow years with more than 4 digits (but not all browsers support it).
See #13735 for some context.

Copy link
Contributor Author

@Narretz Narretz Apr 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this plnkr, http://plnkr.co/edit/TkRo7GD139Pab0qC5ZEm?p=preview it seems to be the case that there is no way to enter a year with more than 4 digits in Edge currently. In Chrome, I can always use the keyboard to input the parts of the date, and so I can also enter 5 digit dates. In Edge it looks like I can only select a date from the picker. Is this correct? This seems like a UX issue to me, and a bug in Edge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, it is indeed not possible to set the date without using the picker (unless you open up dev tools and set the value property directly). I guess it is a conscious choice (albeit one I'm not a big fan of 😛).

Copy link

@AmazingJaze AmazingJaze Apr 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tips @Narretz and @gkalpak. I will follow up with the EdgeHTML folks internally about both of these issues regarding date inputs. Cheers 🍻

helper.changeInputValueTo('10123-03');
expect(+$rootScope.value).toBe(Date.UTC(10123, 2, 1, 0, 0, 0));
if (!isEdge) {
it('should allow four or more digits in year', function() {
var inputElm = helper.compileInput('<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>');

$rootScope.$apply(function() {
$rootScope.value = new Date(Date.UTC(20456, 3, 1, 0, 0, 0));
});
expect(inputElm.val()).toBe('20456-04');
});
helper.changeInputValueTo('10123-03');
expect(+$rootScope.value).toBe(Date.UTC(10123, 2, 1, 0, 0, 0));

$rootScope.$apply(function() {
$rootScope.value = new Date(Date.UTC(20456, 3, 1, 0, 0, 0));
});
expect(inputElm.val()).toBe('20456-04');
});
}

it('should only change the month of a bound date', function() {
var inputElm = helper.compileInput('<input type="month" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />');
Expand Down Expand Up @@ -899,17 +904,19 @@ describe('input', function() {
expect(inputElm).toBeValid();
});

it('should allow four or more digits in year', function() {
var inputElm = helper.compileInput('<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>');
if (!isEdge) {
it('should allow four or more digits in year', function() {
var inputElm = helper.compileInput('<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}"/>');

helper.changeInputValueTo('10123-W03');
expect(+$rootScope.value).toBe(Date.UTC(10123, 0, 21));
helper.changeInputValueTo('10123-W03');
expect(+$rootScope.value).toBe(Date.UTC(10123, 0, 21));

$rootScope.$apply(function() {
$rootScope.value = new Date(Date.UTC(20456, 0, 28));
$rootScope.$apply(function() {
$rootScope.value = new Date(Date.UTC(20456, 0, 28));
});
expect(inputElm.val()).toBe('20456-W04');
});
expect(inputElm.val()).toBe('20456-W04');
});
}

it('should use UTC if specified in the options', function() {
var inputElm = helper.compileInput('<input type="week" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />');
Expand Down Expand Up @@ -1195,18 +1202,22 @@ describe('input', function() {
expect(+$rootScope.value).toBe(+new Date(2000, 0, 1, 1, 2, 0));
});

it('should allow four or more digits in year', function() {
var inputElm = helper.compileInput('<input type="datetime-local" ng-model="value" />');

helper.changeInputValueTo('10123-01-01T01:02');
expect(+$rootScope.value).toBe(+new Date(10123, 0, 1, 1, 2, 0));
if (!isEdge) {
it('should allow four or more digits in year', function() {
var inputElm = helper.compileInput('<input type="datetime-local" ng-model="value" />');

helper.changeInputValueTo('10123-01-01T01:02');
expect(+$rootScope.value).toBe(+new Date(10123, 0, 1, 1, 2, 0));

$rootScope.$apply(function() {
$rootScope.value = new Date(20456, 1, 1, 1, 2, 0);
});
expect(inputElm.val()).toBe('20456-02-01T01:02:00.000');
}
);
}

$rootScope.$apply(function() {
$rootScope.value = new Date(20456, 1, 1, 1, 2, 0);
});
expect(inputElm.val()).toBe('20456-02-01T01:02:00.000');
}
);

it('should label parse errors as `datetimelocal`', function() {
var inputElm = helper.compileInput('<input type="datetime-local" ng-model="val" name="alias" />', {
Expand Down Expand Up @@ -1800,19 +1811,20 @@ describe('input', function() {
}
);

it('should allow four or more digits in year', function() {
var inputElm = helper.compileInput('<input type="date" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />');

helper.changeInputValueTo('10123-01-01');
expect(+$rootScope.value).toBe(Date.UTC(10123, 0, 1, 0, 0, 0));
if (!isEdge) {
it('should allow four or more digits in year', function() {
var inputElm = helper.compileInput('<input type="date" ng-model="value" ng-model-options="{timezone: \'UTC\'}" />');

$rootScope.$apply(function() {
$rootScope.value = new Date(Date.UTC(20456, 1, 1, 0, 0, 0));
});
expect(inputElm.val()).toBe('20456-02-01');
}
);
helper.changeInputValueTo('10123-01-01');
expect(+$rootScope.value).toBe(Date.UTC(10123, 0, 1, 0, 0, 0));

$rootScope.$apply(function() {
$rootScope.value = new Date(Date.UTC(20456, 1, 1, 0, 0, 0));
});
expect(inputElm.val()).toBe('20456-02-01');
}
);
}

it('should label parse errors as `date`', function() {
var inputElm = helper.compileInput('<input type="date" ng-model="val" name="alias" />', {
Expand Down Expand Up @@ -4224,10 +4236,14 @@ describe('input', function() {
});

expect(inputElm[0].value).toBe('');
// Support: IE 9-11
// Support: IE 9-11, Edge
// In IE it is not possible to remove the `value` attribute from an input element.
if (!msie) {
if (!msie && !isEdge) {
expect(inputElm[0].getAttribute('value')).toBeNull();
} else {
// Support: IE 9-11, Edge
// This will fail if the Edge bug gets fixed
expect(inputElm[0].getAttribute('value')).toBe('something');
}
});

Expand Down