Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mochify/driver-webdriver

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mochify/driver-webdriver

WebDriver driver for Mochify

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Mochify driver for WebDriver

Local Selenium

Installing selenium server on Mac OS:

brew install selenium-server
brew install geckodriver

Starting the server:

selenium-server standalone --port 4444

Configuration for local Selenium:

{
  "driver": "webdriver",
  "driver_options": {
    "hostname": "localhost",
    "path": "/wd/hub",
    "port": 4444,
    "capabilities": {
      "browserName": "firefox"
    }
  }
}

Local SafariDriver

The safaridriver executable is included with Safari 13 and later.

Initializing safaridriver (only once):

safaridriver --enable

Staring the server:

safaridriver --port 4444

Configuration for local Safari:

{
  "driver": "webdriver",
  "driver_options": {
    "hostname": "localhost",
    "path": "/",
    "port": 4444,
    "capabilities": {
      "browserName": "safari"
    }
  }
}

Running tests in iOS simulator:

{
  "driver": "webdriver",
  "driver_options": {
    "hostname": "localhost",
    "path": "/",
    "port": 4444,
    "capabilities": {
      "browserName": "safari",
      "platformName": "iOS",
      "safari:useSimulator": true,
      "safari:deviceType": "iPhone"
    }
  }
}

See man safaridriver for available capabilities.

IMPORTANT! You must run your tests in the context of an actual website or webdriver will fail with a security warning. Use --serve . to let Mochify handle this for you.

SauceLabs

Config for SauceLabs:

module.exports = {
  driver: 'webdriver',
  driver_options: {
    hostname: 'ondemand.saucelabs.com',
    path: '/wd/hub',
    port: 80,
    capabilities: {
      browserName: process.env.BROWSER_NAME,
      'sauce:options': {
        username: process.env.SAUCE_USERNAME,
        accessKey: process.env.SAUCE_ACCESS_KEY
      }
    }
  }
};
BROWSER_NAME="safari"; mochify --driver webdriver test.js

Keywords

FAQs

Package last updated on 27 Dec 2023

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