New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wdio-safaridriver-service

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wdio-safaridriver-service

WebdriverIO service to start & stop safaridriver

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.1K
increased by2.3%
Maintainers
1
Weekly downloads
 
Created
Source

WDIO SafariDriver Service

(Based entirely on wdio-edgedriver-service... which itself was based entirely on wdio-chromedriver-service... which was based on selenium-standalone-service. I think thats it)

Note - this service is targeted at WDIO v5.


This service helps you to run the Safari browser seamlessly when running tests with the WDIO testrunner. It uses the /usr/bin/safaridriver that comes with Safari/OSX.

Note - this service does not require a Selenium server, but uses the /usr/bin/safaridriver to communicate with the browser directly. Obvisously, it only supports:

capabilities: [{
        browserName: 'safari'
    }]

Installation

The easiest way is to keep wdio-safaridriver-service as a devDependency in your package.json.

{
  "devDependencies": {
    "wdio-safaridriver-service": "^0.0.1"
  }
}

You can simple do it by:

npm install wdio-safaridriver-service --save-dev

Instructions on how to install WebdriverIO can be found here.

Configure Safari to Enable WebDriver Support

Safari’s WebDriver support for developers is turned off by default. How you enable it depends on your operating system.

High Sierra and later:

Run safaridriver --enable once. (If you’re upgrading from a previous macOS release, you may need to use sudo.)

Sierra and earlier:

  1. If you haven’t already done so, make the Develop menu available. Choose Safari > Preferences, and on the Advanced tab, select “Show Develop menu in menu bar.” For details, see Safari Help.

  2. Choose Develop > Allow Remote Automation.

  3. Authorize safaridriver to launch the XPC service that hosts the local web server. To permit this, manually run /usr/bin/safaridriver once and follow the authentication prompt.

Configuration

By design, only Safari is available, and will only work on Mac OS. In order to use the service you need to add safaridriver to your service array:

// wdio.conf.js
export.config = {
  // port to find safaridriver
  port: 4447, // if you want to specify the port. Default is 4444
  path: '/',
  // ...
  capabilities: [{
    /*
     * safaridriver can only handle 1 instance unfortunately
     * https://developer.apple.com/documentation/webkit/about_webdriver_for_safari
     */
    maxInstances: 1, 
  }],
  services: ['safaridriver'],

  // options
  safaridriverArgs: ['-p 4444'], // use the specified port. Default is 4444
  safaridriverLogs: './',
  // ...
};

Options

safaridriverArgs

Array of arguments to pass to the safaridriver executable.

  • -p will use wdioConfig.port if not specified
  • etc.

Type: string[]

safaridriverLogs

Path where all logs from the safaridriver server should be stored.

Type: string


For more information on WebdriverIO see the homepage.

Keywords

FAQs

Package last updated on 18 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc