Skip to content

Commit 1c9be9b

Browse files
committed
chore(build): add Firefox to CI
1 parent 49997ca commit 1c9be9b

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

modules/angular2/src/test_lib/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,8 @@ export function stringifyElement(el): string {
9292
export function supportsIntlApi(): boolean {
9393
return DOM.getUserAgent().indexOf('Chrome') > -1 && DOM.getUserAgent().indexOf('Edge') == -1;
9494
}
95+
96+
// TODO(mlaval): extract all browser detection checks from all tests
97+
export function isFirefox(): boolean {
98+
return DOM.getUserAgent().indexOf("Firefox") > -1;
99+
}

modules/angular2/test/forms/integration_spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {
1414
it,
1515
inject,
1616
iit,
17-
xit
17+
xit,
18+
isFirefox
1819
} from 'angular2/test_lib';
1920

2021
import {DOM} from 'angular2/src/dom/dom_adapter';
@@ -737,6 +738,13 @@ export function main() {
737738
rootTC.componentInstance.form = form;
738739
rootTC.detectChanges();
739740

741+
// In Firefox, effective text selection in the real DOM requires an actual focus
742+
// of the field. This is not an issue in a new HTML document.
743+
if (isFirefox()) {
744+
var fakeDoc = DOM.createHtmlDocument();
745+
DOM.appendChild(fakeDoc.body, rootTC.nativeElement);
746+
}
747+
740748
var input = rootTC.query(By.css("input")).nativeElement;
741749
input.value = "aa";
742750
input.selectionStart = 1;

sauce.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var aliases = {
125125
'SAFARI': ['SL_SAFARI7', 'SL_SAFARI8'],
126126
'BETA': ['SL_CHROMEBETA', 'SL_FIREFOXBETA'],
127127
'DEV': ['SL_CHROMEDEV', 'SL_FIREFOXDEV'],
128-
'CI': ['SL_CHROME', 'SL_ANDROID5.1', 'SL_SAFARI8', 'SL_IOS8']
128+
'CI': ['SL_CHROME', 'SL_ANDROID5.1', 'SL_SAFARI8', 'SL_IOS8', 'SL_FIREFOX']
129129
};
130130

131131
module.exports = {

0 commit comments

Comments
 (0)