lightfoot
Run your own tests in a real browser with selenium then stream the results out. Uses leadfoot under the hood.
install
npm install lightfoot --save-dev
usage
Install and run a Selenium Server.
Add a test
target to your scripts
of your package.json
:
Then run the command npm test
to run your test URL in a real browser via selenium.
notifying lightfoot
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:
windowNOTIFY_LIGHTFOOT
An example adapter if you're using QUnit:
windowNOTIFY_LIGHTFOOT = { payloadtype = type windowNOTIFY_LIGHTFOOT}QUnitQUnitQUnitQUnit
and now lightfoot will know and report more info about the lifecycle of your test suite.
api usage
// Create an instance of lightfootvar lightfoot = url: 'http://localhost:3000/test.html' browserName: 'firefox' varName: 'window.NOTIFY_LIGHTFOOT' // Open a session and run the testslightfoot // Pipe to built in tap reporter or your own reporterlightfoot
running multiple sessions concurrently
There is a built in helper to run mutliple sessions concurrently:
var runAll = runAll// Run each of these sessions with 2 at a time concurrently
using with sauce labs
Install and run Sauce Connect
Specify the Sauce Labs Selenium web driver URL with your username and access key:
url: 'http://localhost:3000/test.html' seleniumUrl: 'http://username:accessKey@ondemand.saucelabs.com:80/wd/hub'
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.
Release History
- 1.6.1 - Fix for running a single test runner.
- 1.6.0 - Add pollInterval option to delay how often we poll the console.
- 1.5.0 - Rename
log
event toassertion
.log
is now used to trackconsole.log
messages in the browser. - 1.4.0 - Ability to specify capabilities. Helper for running multiple sessions concurrently. Pipe errors to reporter when they occur.
- 1.3.1 - Add repository field to package.json. Ensure assertions on pretty reporter go on their own line.
- 1.3.0 - Add pretty reporter
- 1.2.1 - Avoid multiple
done()
calls on finish - 1.2.0 - Do not call
quit()
automatically any more to allow for async clean up. User must callquit()
- 1.1.1 - Ensure quit is called before runCallback
- 1.1.0 - Fixes to prevent runner from hanging. id is no longer required. Fixes to tap reporter. session and sessionId is exposed. quit is called upon the end automatically now.
- 1.0.0 - Initial release
License
Copyright (c) 2014 YouNeedABudget.com Licensed under the MIT license.