Installation
Prerequisites
- Node.js 20 or later
- An existing project directory
Run the installer
npx letsrunit init
init is interactive: it walks you through each step and asks before making changes. It's safe to re-run at any time.
What does the installer do?
Install the CLI
@letsrunit/cli is added to your project's dev dependencies. It provides the letsrunit binary for explore, generate, and run.
Install Cucumber
letsrunit uses Cucumber.js as the test runner. If it's not already installed, the wizard will offer to add @cucumber/cucumber to your dev dependencies.
It also creates two files:
cucumber.js tells Cucumber where your app is running:
export default {
worldParameters: {
baseURL: 'http://localhost:3000',
},
};
features/support/world.js loads the letsrunit step library:
import { setDefaultTimeout } from '@cucumber/cucumber';
import '@letsrunit/cucumber';
setDefaultTimeout(30_000);
Create the features directory
If your project has no .feature files yet, init creates features/example.feature with a minimal scenario to verify the setup works:
Feature: Example
Scenario: Homepage loads
Given I'm on the homepage
Install Playwright browsers
letsrunit drives a real Chromium browser. If Playwright's Chromium binary isn't found, the wizard offers to install it:
npx playwright install chromium
Run npx letsrunit init again at any time to add steps you skipped the first time.