Skip to content

Commit f8fa5d6

Browse files
committed
build: run less browsers on saucelabs
* Better balance between Saucelabs and Browserstack because Browserstack runs more stable. Considering that e2e tests also run on Saucelabs it's fair running more on Browserstack.
1 parent f89c6db commit f8fa5d6

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

src/lib/core/platform/platform.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@ export class Platform {
3737

3838
// Trident on mobile adds the android platform to the userAgent to trick detections.
3939
ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;
40+
41+
// Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
42+
// this and just place the Safari keyword in the userAgent. To be more safe about Safari every
43+
// Safari browser should also use Webkit as its layout engine.
44+
SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;
4045
}

src/lib/input/input-container.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
} from './input-container-errors';
2525
import {MD_PLACEHOLDER_GLOBAL_OPTIONS} from '../core/placeholder/placeholder-options';
2626

27-
2827
describe('MdInputContainer', function () {
2928
beforeEach(async(() => {
3029
TestBed.configureTestingModule({
@@ -108,7 +107,7 @@ describe('MdInputContainer', function () {
108107

109108
it('should not be treated as empty if type is date',
110109
inject([Platform], (platform: Platform) => {
111-
if (!(platform.TRIDENT || platform.FIREFOX)) {
110+
if (!(platform.TRIDENT || platform.FIREFOX || (platform.SAFARI && !platform.IOS))) {
112111
let fixture = TestBed.createComponent(MdInputContainerDateTestController);
113112
fixture.detectChanges();
114113

@@ -118,10 +117,10 @@ describe('MdInputContainer', function () {
118117
}
119118
}));
120119

121-
// Firefox and IE don't support type="date" and fallback to type="text".
120+
// Firefox, Safari Desktop and IE don't support type="date" and fallback to type="text".
122121
it('should be treated as empty if type is date on Firefox and IE',
123122
inject([Platform], (platform: Platform) => {
124-
if (platform.TRIDENT || platform.FIREFOX) {
123+
if (platform.TRIDENT || platform.FIREFOX || (platform.SAFARI && !platform.IOS)) {
125124
let fixture = TestBed.createComponent(MdInputContainerDateTestController);
126125
fixture.detectChanges();
127126

test/browser-providers.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* Target can be either: BS (Browserstack) | SL (Saucelabs) | null (To not run at all)
66
*/
77
const browserConfig = {
8-
'Chrome': { unitTest: {target: 'SL', required: true }},
9-
'Firefox': { unitTest: {target: 'SL', required: true }},
10-
'ChromeBeta': { unitTest: {target: 'SL', required: false }},
8+
'Chrome': { unitTest: {target: 'BS', required: true }},
9+
'Firefox': { unitTest: {target: 'BS', required: true }},
10+
'ChromeBeta': { unitTest: {target: null, required: false }},
1111
'FirefoxBeta': { unitTest: {target: null, required: false }},
1212
'ChromeDev': { unitTest: {target: null, required: true }},
1313
'FirefoxDev': { unitTest: {target: null, required: true }},
@@ -19,15 +19,15 @@ const browserConfig = {
1919
'Android4.2': { unitTest: {target: null, required: false }},
2020
'Android4.3': { unitTest: {target: null, required: false }},
2121
'Android4.4': { unitTest: {target: null, required: false }},
22-
'Android5': { unitTest: {target: 'SL', required: false }},
22+
'Android5': { unitTest: {target: null, required: false }},
2323
'Safari7': { unitTest: {target: null, required: false }},
2424
'Safari8': { unitTest: {target: null, required: false }},
25-
'Safari9': { unitTest: {target: 'BS', required: false }},
26-
'Safari10': { unitTest: {target: 'SL', required: false }},
25+
'Safari9': { unitTest: {target: 'SL', required: true }},
26+
'Safari10': { unitTest: {target: 'BS', required: true }},
2727
'iOS7': { unitTest: {target: null, required: false }},
2828
'iOS8': { unitTest: {target: null, required: false }},
2929
'iOS9': { unitTest: {target: 'BS', required: true }},
30-
'WindowsPhone': { unitTest: {target: 'BS', required: false }}
30+
'WindowsPhone': { unitTest: {target: null, required: false }}
3131
};
3232

3333
/** Exports all available remote browsers. */
@@ -63,4 +63,4 @@ function decodeToken(token) {
6363
if (process.env.TRAVIS) {
6464
process.env.SAUCE_ACCESS_KEY = decodeToken(process.env.SAUCE_ACCESS_KEY);
6565
process.env.BROWSER_STACK_ACCESS_KEY = decodeToken(process.env.BROWSER_STACK_ACCESS_KEY);
66-
}
66+
}

test/remote_browsers.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@
167167
"os": "OS X",
168168
"os_version": "El Capitan"
169169
},
170+
"BS_SAFARI10": {
171+
"base": "BrowserStack",
172+
"browser": "safari",
173+
"browser_version": "10.1",
174+
"os": "OS X",
175+
"os_version": "Sierra"
176+
},
170177
"BS_IOS7": {
171178
"base": "BrowserStack",
172179
"device": "iPhone 5S",
@@ -251,4 +258,4 @@
251258
"os": "android",
252259
"os_version": "4.1"
253260
}
254-
}
261+
}

0 commit comments

Comments
 (0)