Launcher for Safari.
There were some important Pull Requests open for us (not from us) and for the meantime we concat them all in this repo for us:
- Merged PR: karma-runner#14 so karma test tabs will be closed.
- Merged PR: karma-runner#22 to use WebDriver to run tests (preferred solution).
How does this work? (https://webkit.org/blog/6900/webdriver-support-in-safari-10/)
- It launches
/usr/bin/safaridriver
on a specified port (defaults to 4444). - It then "ping"s the safaridriver until it starts accepting incoming connections.
- Creates a new WebDriver session (e.g., opens Safari).
- Navigates to the Karma provided URL.
To use this you need to do following setup steps:
- Enable Remote Automation in safari (in dev tools settings)
- Authorize safaridriver:
sudo /usr/bin/safaridriver --enable
The easiest way is to keep karma-safari-launcher
as a devDependency in your package.json
.
{
"devDependencies": {
"karma": "~0.10",
"karma-safari-launcher": "~0.1"
}
}
You can simple do it by:
npm install karma-safari-launcher --save-dev
// karma.conf.js
module.exports = function(config) {
config.set({
browsers: ['Safari']
});
};
You can pass list of browsers as a CLI argument too:
karma start --browsers Safari
For more information on Karma see the homepage.