
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
Run your own tests in a real browser with selenium then stream the results out. Uses leadfoot under the hood.
npm install lightfoot --save-dev
Install and run a Selenium Server.
Add a test target to your scripts of your package.json:
{
"name": "myapp",
"version": "0.1.0",
"scripts": {
"test": "lightfoot --url=http://localhost:3000/test.html"
},
"devDependencies": {
"lightfoot": "^1.0.0"
}
}
Then run the command npm test to run your test URL in a real browser via selenium.
Your test suite can communicate with lightfoot using a global variable stack: window.NOTIFY_LIGHTFOOT
When your tests are done, push an object to the stack:
window.NOTIFY_LIGHTFOOT.push({ type: 'done', passed: 2, failed: 1 })
An example adapter if you're using QUnit:
window.NOTIFY_LIGHTFOOT = []
function notifyLightfoot(type, payload) {
payload.type = type
window.NOTIFY_LIGHTFOOT.push(payload)
}
QUnit.begin(function(data) { notifyLightfoot('begin', data) })
QUnit.done(function(data) { notifyLightfoot('done', data) })
QUnit.testDone(function(data) { notifyLightfoot('testDone', data) })
QUnit.log(function(data) { notifyLightfoot('log', data) })
and now lightfoot will know and report more info about the lifecycle of your test suite.
// Create an instance of lightfoot
var lightfoot = require('lightfoot')({
url: 'http://localhost:3000/test.html',
browserName: 'firefox',
varName: 'window.NOTIFY_LIGHTFOOT',
})
// Open a session and run the tests
lightfoot.run(function(code) {
process.exit(code || 0)
})
// Pipe to built in tap reporter or your own reporter
lightfoot.pipe(require('lightfoot/reporters/tap')()).pipe(process.stdout)
Install and run Sauce Connect
Specify the Sauce Labs Selenium web driver URL with your username and access key:
require('lightfoot')({
url: 'http://localhost:3000/test.html',
seleniumUrl: 'http://username:accessKey@ondemand.saucelabs.com:80/wd/hub',
}).run(function(code) {
process.exit(code || 0)
})
Now through all kinds of mad science, your tests served locally are ran in a real browser at Sauce Labs and reported to your terminal.
done() calls on finishquit() automatically any more to allow for async clean up. User must call quit()Copyright (c) 2014 YouNeedABudget.com Licensed under the MIT license.
FAQs
Run your own tests in a real browser with selenium then stream the results out.
The npm package lightfoot receives a total of 1 weekly downloads. As such, lightfoot popularity was classified as not popular.
We found that lightfoot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.