
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
selenium-mocha
Advanced tools
run selenium tests in the browser using generators and mocha
npm install selenium-mocha
For full example see "test" folder. A fresh browser is automatically created and disposed of for each test case. Each test case runs in parallel by default (unless you use --grep which forces it into serial operation).
'use strict';
var assert = require('assert');
var chromedriver = require('chromedriver');
var browser = require('selenium-mocha');
chromedriver.start();
browser.remote('http://localhost:9515/').timeout('60s').operationTimeout('5s');
after(function () {
chromedriver.stop();
});
describe('www.example.com', function () {
it('Has a header that reads "Example Domain"', browser(function* (browser) {
yield browser.get('http://www.example.com');
var heading = yield browser.elementByTagName('h1').text();
assert(heading.trim() == 'Example Domain');
}));
});
Initialization. Configure the following settings:
//configure how to connect to the remote using the same arguments as `wd.remote`
browser.remote(...args);
//set a timeout for all browser test cases
browser.timeout('60s');
//set a timeout that gets reset once each `yield` statement completes
browser.operationTimeout('5s');
//optionaly force all tests to evaluate in sequence (this is typically much slower)
browser.lazy();
You can also pass any of those as options.
To enable generators, install gnode via npm install gnode --save-dev then enable them by creating a mocha.otps file in the unit tests folder with the following body:
--require gnode
This will precompile files using facebook's regenerator.
MIT
FAQs
run selenium tests in the browser
We found that selenium-mocha demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.