Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Commit

Permalink
Added browsername selection functionality
Browse files Browse the repository at this point in the history
Updated README with end-to-end browser information
  • Loading branch information
jforbes committed Jun 24, 2015
1 parent 479cc43 commit 3a47203
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 13 deletions.
60 changes: 52 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,51 @@ module.exports = function(grunt) {
}
},
protractor: {
test: {
options: {
configFile: 'test/functional/protractor.config.js'
},

chrome: {
options: {
configFile: 'test/functional/protractor.config.js'
args: {
capabilities: {
browserName: 'chrome'
}
}
}
}
},

firefox: {
options: {
args: {
capabilities: {
browserName: 'firefox'
}
}
}
},

safari: {
options: {
args: {
capabilities: {
browserName: 'safari'
}
}
}
},

ie: {
options: {
args: {
capabilities: {
browserName: 'internet explorer'
}
}
}
},

saucelabs:{}
}
});

Expand Down Expand Up @@ -307,20 +347,24 @@ module.exports = function(grunt) {
grunt.task.run(['karma:phantomjs']);
} else if (process.env.TRAVIS) {
grunt.task.run(['karma:saucelabs']);
grunt.task.run(['connect:test', 'protractor']);
grunt.task.run(['connect:test', 'protractor:saucelabs']);
} else {
if (tasks.length === 0) {
tasks.push('chrome');
}
if (tasks.length === 1) {
tasks = tasks[0].split(',');
}
tasks = tasks.map(function(el) {
return 'karma:' + el;
});
tasks = tasks.reduce(function(acc, el) {
acc.push('karma:' + el);
if (/chrome|firefox|safari|ie/.test(el)) {
acc.push('protractor:' + el);
}
return acc;
}, []);
tasks = ['update-webdriver', 'connect:test'].concat(tasks);

grunt.task.run(tasks);
grunt.task.run(['update-webdriver', 'connect:test', 'protractor']);
}
});
};
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ the web](http://www.html5rocks.com/en/tutorials/track/basics/).
### Testing

For testing, you can either run `npm test` or use `grunt` directly.
If you use `npm test`, it will only run the karma tests using chrome.
If you use `npm test`, it will only run the karma and end-to-end tests using chrome.
You can specify which browsers you want the tests to run via grunt's `test` task.
You can use either grunt-style arguments or comma separated arguments:
```
Expand All @@ -201,10 +201,14 @@ Possible options are:
* `chromecanary`
* `phantomjs`
* `opera`
* `chrome`
* `safari`
* `firefox`
* `ie`
* `chrome`<sup>1</sup>
* `safari`<sup>1, 2</sup>
* `firefox`<sup>1</sup>
* `ie`<sup>1</sup>


_<sup>1</sup>supported end-to-end browsers_<br />
_<sup>2</sup>requires the [SafariDriver extension]( https://code.google.com/p/selenium/wiki/SafariDriver) to be installed_

## Hosting Considerations
Unlike a native HLS implementation, the HLS tech has to comply with
Expand Down

0 comments on commit 3a47203

Please sign in to comment.