Socket
Socket
Sign inDemoInstall

selenium-mock

Package Overview
Dependencies
77
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    selenium-mock

A barebones mock selenium server (but easily extensible!)


Version published
Weekly downloads
21
increased by110%
Maintainers
1
Install size
2.48 MB
Created
Weekly downloads
 

Readme

Source

Selenium Mock

This is an extremely barebones mock selenium server. Out of the box, it only supports status and creating/closing/describing/listing sessions. The idea is for you to add your own commands as needed:

import {Server, Session as BasicSession, Command} from 'selenium-mock';

interface Session extends BasicSession {
  url: string
}
// Support for webdriver.WebDriver.prototype.get
let setUrl = new Command<MySession>('POST', 'url', (session, params) => {
  session.url = params['url'];
});
// Support for webdriver.WebDriver.prototype.getCurrentUrl
let getUrl = new Command<MySession>('GET', 'url', (session, params) => {
  return session.url;
});

let server = new Server<Session>(4444);
server.addCommand(setUrl);
server.addCommand(getUrl);
server.start();

See spec/custom_command_spec.ts for an example

Keywords

FAQs

Last updated on 12 Dec 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc