Skip to content

build: run fewer browsers on saucelabs #5045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 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
5 changes: 5 additions & 0 deletions src/lib/core/platform/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ export class Platform {

// Trident on mobile adds the android platform to the userAgent to trick detections.
ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;

// Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
// this and just place the Safari keyword in the userAgent. To be more safe about Safari every
// Safari browser should also use Webkit as its layout engine.
SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;
}
7 changes: 3 additions & 4 deletions src/lib/input/input-container.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
} from './input-container-errors';
import {MD_PLACEHOLDER_GLOBAL_OPTIONS} from '../core/placeholder/placeholder-options';


describe('MdInputContainer', function () {
beforeEach(async(() => {
TestBed.configureTestingModule({
Expand Down Expand Up @@ -108,7 +107,7 @@ describe('MdInputContainer', function () {

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

Expand All @@ -118,10 +117,10 @@ describe('MdInputContainer', function () {
}
}));

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

Expand Down
16 changes: 8 additions & 8 deletions test/browser-providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Target can be either: BS (Browserstack) | SL (Saucelabs) | null (To not run at all)
*/
const browserConfig = {
'Chrome': { unitTest: {target: 'SL', required: true }},
'Firefox': { unitTest: {target: 'SL', required: true }},
'ChromeBeta': { unitTest: {target: 'SL', required: false }},
'Chrome': { unitTest: {target: 'BS', required: true }},
'Firefox': { unitTest: {target: 'BS', required: true }},
'ChromeBeta': { unitTest: {target: null, required: false }},
'FirefoxBeta': { unitTest: {target: null, required: false }},
'ChromeDev': { unitTest: {target: null, required: true }},
'FirefoxDev': { unitTest: {target: null, required: true }},
Expand All @@ -19,15 +19,15 @@ const browserConfig = {
'Android4.2': { unitTest: {target: null, required: false }},
'Android4.3': { unitTest: {target: null, required: false }},
'Android4.4': { unitTest: {target: null, required: false }},
'Android5': { unitTest: {target: 'SL', required: false }},
'Android5': { unitTest: {target: null, required: false }},
'Safari7': { unitTest: {target: null, required: false }},
'Safari8': { unitTest: {target: null, required: false }},
'Safari9': { unitTest: {target: 'BS', required: false }},
'Safari10': { unitTest: {target: 'SL', required: false }},
'Safari9': { unitTest: {target: 'SL', required: true }},
'Safari10': { unitTest: {target: 'BS', required: true }},
'iOS7': { unitTest: {target: null, required: false }},
'iOS8': { unitTest: {target: null, required: false }},
'iOS9': { unitTest: {target: 'BS', required: true }},
'WindowsPhone': { unitTest: {target: 'BS', required: false }}
'WindowsPhone': { unitTest: {target: null, required: false }}
};

/** Exports all available remote browsers. */
Expand Down Expand Up @@ -63,4 +63,4 @@ function decodeToken(token) {
if (process.env.TRAVIS) {
process.env.SAUCE_ACCESS_KEY = decodeToken(process.env.SAUCE_ACCESS_KEY);
process.env.BROWSER_STACK_ACCESS_KEY = decodeToken(process.env.BROWSER_STACK_ACCESS_KEY);
}
}
9 changes: 8 additions & 1 deletion test/remote_browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@
"os": "OS X",
"os_version": "El Capitan"
},
"BS_SAFARI10": {
"base": "BrowserStack",
"browser": "safari",
"browser_version": "10.1",
"os": "OS X",
"os_version": "Sierra"
},
"BS_IOS7": {
"base": "BrowserStack",
"device": "iPhone 5S",
Expand Down Expand Up @@ -251,4 +258,4 @@
"os": "android",
"os_version": "4.1"
}
}
}