
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Easy, robust end-to-end UI tests for web apps.
Features:
Assuming you have a npm run watch script in your project, which starts your web server
on port 3000:
npm install --save-dev ottr
node_modules/.bin/ottr --server 'npm run watch' localhost:3000 src/test/e2e/index.js
Then just visit the URL printed to the console (defaults to http://localhost:50505/ottr/ui)
Usage: ottr [options] <url> <file>
url: the website to run your tests against
file: root end-to-end test file that runs all your tests
Options:
-s, --server <cmd> command ottr uses to launch your server, e.g. 'npm run watch'
-c, --chrome opens headless Chrome/Chromium to the ottr UI to run your tests
--chromium <path> uses the specified Chrome/Chromium binary to run your tests
--host <ip> Chrome will use this hostname or IP address instead of localhost
--coverage <type> use 'chrome' for code coverage from Chrome DevTools (see below)
--screenshots take screenshots every 100ms
--concurrency <n> number of tests ottr should run in simultaneous iframes
--wait-timeout <secs> max server startup wait time (see --wait-path)
--wait-path <path> wait for your server to return 200 for this path (e.g., /health)
-d, --debug keep ottr running indefinitely after tests finish
-i, --inspect runs Chrome in GUI mode so you can watch tests run interactively
-h, --help output usage information
ottr tests are written using a wrapper around tape, a simple yet powerful testing and assertion library.
import {setValue, sleep, test} from 'ottr';
import $ from 'jquery';
test('searching for uuid works', '/', async t => {
$('.search-icon').click();
setValue($('.searchBox input')[0], 'doctor');
await sleep(500);
t.equal($('.result').text(), 'Doctor Seuss');
t.end();
});
$ ottr --chrome --debug localhost:9999 src/test/e2e.js
Runs your tests in e2e.js against your local development server using a headless Chrome browser. The --debug option leaves ottr running so you can debug interactively using the browser of your choice. (Your server must already be running on port 9999.)
$ nyc --reporter=html ottr --coverage=chrome https://google.com dist-test/e2e.js
Runs your tests against Google's home page, in a Chrome headless browser, with Chrome's built-in code coverage recording. nyc (the istanbul command-line tool) generates an HTML coverage report.
How does ottr work?
ottr's main benefit is that it runs your test code inside your web app itself, rather than in a separate browser window or Node process.
However, this gets a little tricky because of web standards, particularly cross-origin protections. To bypass browser security, ottr:
http-proxy-middleware)webpack)We'd love for you to contribute to this project. Before we can accept your contributions, we kindly ask you to sign our Uber Contributor License Agreement.
Thanks!
FAQs
Run end-to-end tests in a web browser
We found that ottr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.