Scaffold tool for testla-screenplay projects
npm install @testla/create-screenplayThis package provides an initializer to interactively and automatically set up new Testla Screenplay projects with Playwright.
You can create a new Testla Screenplay project using one of the following commands:
``bash`In the current directory (recommended: create an empty directory first)
npm init @testla/screenplay
npx @testla/create-screenplay
yarn create @testla/screenplay
pnpm create @testla/screenplay
The tool uses the current directory name as the project name and sets up the project structure there.
Example:
`bash`
mkdir my-tests
cd my-tests
npm init @testla/screenplayProject name is "my-tests"
1. Interactive configuration (prompts):
- Name of the test directory (default: tests)
- Base URL of the application under test
- Browser (chromium, firefox, webkit)
- Headless mode (default: true)
- Reporter (testla-reporter, html, junit, json, list, dot)
2. Project structure is created:
``
āāā
āāā screenplay/
ā āāā tasks/ # Example task
ā āāā actions/ # (empty)
ā āāā questions/ # (empty)
ā āāā screens/ # Example screen
āāā fixtures/ # Test actor
āāā playwright.config.ts # Playwright configuration
āāā .env # Environment variables
āāā .gitignore # Git ignore
āāā README.md # Project documentation (generated)
āāā package.json
3. Dependencies are installed:
- @playwright/test@testla/screenplay-playwright
- dotenv
- @types/node
- (dev)
4. Configuration and example files are generated:
- Playwright configuration (playwright.config.ts).env
- file with your settings
- Example test, demo task, demo screen, fixtures
- Project-specific README (replaces this file in the target project)
5. package.json is updated:
- Script: test ā npx playwright test
- š ļø Interactive setup with sensible defaults
- š Automatic folder structure following the Screenplay pattern
- š Ready to use with example code and configuration
- š Multi-browser support (Chromium, Firefox, WebKit)
- š Generates a README for the new project
`
ā Success! Created a Testla Screenplay project at /path/to/project
We suggest that you begin by typing:
npm test
Runs the end-to-end tests.
And check out the following files:
- ./
- ./fixtures/user.ts - Definition of the Actor
- ./screenplay/tasks/demo-task.ts - Example task
- ./screenplay/screens/demo-screen.ts - Example screen
- ./playwright.config.ts - Playwright configuration
- ./.env - Environment variables
⨠More info: https://github.com/testla-project/testla-screenplay-playwright-js/tree/main/docs āØ
š Discord: https://discord.gg/MDRjCH3v š
Happy hacking! š
``
- Node.js 18.0.0 or higher
- npm, yarn, or pnpm
- Testla Screenplay Playwright
- Discord Community
MIT