Skip to content
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

Test using BrowserStack #2492

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
addons:
sauce_connect: true
notifications:
irc:
channels:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ If you're ready to dive in, the [documentation](docs/index.md) is the first plac
## Contributing
Video.js is a free and open source library, and we appreciate any help you're willing to give. Check out the [contributing guide](CONTRIBUTING.md).

_Video.js uses [BrowserStack](https://browserstack.com) for compatibility testing_
## Building your own Video.js from source
To build your own custom version read the section on [contributing code](CONTRIBUTING.md#contributing-code) and ["Building your own copy"](CONTRIBUTING.md#building-your-own-copy-of-videojs) in the contributing guide.

## License

Video.js is licensed under the Apache License, Version 2.0. [View the license file](LICENSE)
Expand Down
17 changes: 9 additions & 8 deletions grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,15 @@ module.exports = function(grunt) {
ie: { browsers: ['IE'] },
phantomjs: { browsers: ['PhantomJS'] },

// this only runs on PRs from the mainrepo on saucelabs
saucelabs: { browsers: ['chrome_sl'] },
chrome_sl: { browsers: ['chrome_sl'] },
firefox_sl: { browsers: ['firefox_sl'] },
safari_sl: { browsers: ['safari_sl'] },
ipad_sl: { browsers: ['ipad_sl'] },
android_sl: { browsers: ['android_sl'] },
ie_sl: { browsers: ['ie_sl'] }
// this only runs on PRs from the mainrepo on BrowserStack
browserstack: { browsers: ['chrome_bs'] },
chrome_bs: { browsers: ['chrome_bs'] },
firefox_bs: { browsers: ['firefox_bs'] },
safari_bs: { browsers: ['safari_bs'] },
ie11_bs: { browsers: ['ie11_bs'] },
ie10_bs: { browsers: ['ie10_bs'] },
ie9_bs: { browsers: ['ie9_bs'] },
ie8_bs: { browsers: ['ie8_bs'] }
},
vjsdocs: {
all: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"grunt-zip": "0.10.2",
"karma": "^0.12.36",
"karma-browserify": "^4.0.0",
"karma-browserstack-launcher": "^0.1.4",
"karma-chrome-launcher": "^0.1.3",
"karma-coverage": "^0.4.0",
"karma-firefox-launcher": "^0.1.3",
Expand All @@ -76,7 +77,6 @@
"karma-phantomjs-launcher": "^0.1.4",
"karma-qunit": "^0.1.2",
"karma-safari-launcher": "^0.1.1",
"karma-sauce-launcher": "^0.2.8",
"karma-sinon": "^1.0.3",
"load-grunt-tasks": "^3.1.0",
"qunitjs": "^1.18.0",
Expand Down
93 changes: 54 additions & 39 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = function(config) {
// Compling tests here
files: [
'../build/temp/video-js.css',
'../build/temp/ie8/videojs-ie8.min.js',
'../test/globals-shim.js',
'../test/unit/**/*.js',
{ pattern: '../src/**/*.js', watched: true, included: false, served: false }
Expand Down Expand Up @@ -44,12 +45,12 @@ module.exports = function(config) {
'karma-opera-launcher',
'karma-phantomjs-launcher',
'karma-safari-launcher',
'karma-sauce-launcher',
'karma-browserstack-launcher',
'karma-browserify',
'karma-coverage'
],

reporters: ['dots', 'saucelabs'],
reporters: ['dots'],

// web server port
port: 9876,
Expand All @@ -61,12 +62,8 @@ module.exports = function(config) {
captureTimeout: 60000,
browserNoActivityTimeout: 60000,

sauceLabs: {
startConnect: false,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
testName: process.env.TRAVIS_BUILD_NUMBER + process.env.TRAVIS_BRANCH,
recordScreenshots: false
browserStack: {
name: process.env.TRAVIS_BUILD_NUMBER + process.env.TRAVIS_BRANCH
},
customLaunchers: getCustomLaunchers(),

Expand All @@ -93,12 +90,15 @@ module.exports = function(config) {
settings.browserify.transform.push('browserify-istanbul');
settings.reporters.push('coverage');

if (process.env.SAUCE_ACCESS_KEY) {
if (process.env.BROWSER_STACK_USERNAME) {
settings.browsers = [
'chrome_sl',
'firefox_sl',
'safari_sl',
'ie_sl'
'chrome_bs',
'firefox_bs',
'safari_bs',
'ie11_bs',
'ie10_bs',
'ie9_bs',
'ie8_bs'
];
} else {
settings.browsers = ['Firefox'];
Expand All @@ -110,42 +110,57 @@ module.exports = function(config) {

function getCustomLaunchers(){
return {
chrome_sl: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 8.1'
chrome_bs: {
base: 'BrowserStack',
browser: 'chrome',
os: 'Windows',
os_version: '8.1'
},

firefox_sl: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Linux'
firefox_bs: {
base: 'BrowserStack',
browser: 'firefox',
os: 'Windows',
os_version: '8.1'
},

safari_sl: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.10'
safari_bs: {
base: 'BrowserStack',
browser: 'safari',
os: 'OS X',
os_version: 'Yosemite'
},

ipad_sl: {
base: 'SauceLabs',
browserName: 'ipad',
platform: 'OS X 10.10',
version: '8.4'
ie11_bs: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11',
os: 'Windows',
os_version: '8.1'
},

android_sl: {
base: 'SauceLabs',
browserName: 'android',
platform:'Linux'
ie10_bs: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '10',
os: 'Windows',
os_version: '7'
},

ie_sl: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
ie9_bs: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '9',
os: 'Windows',
os_version: '7'
},

ie8_bs: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '8',
os: 'Windows',
os_version: '7'
}
};
}