@outliant/generator-automation-tests
v0.2.0
Published
A Yeoman generator for quickly scaffolding automation test projects. Supports Playwright and Selenium + Cucumber, with opinionated templates, configuration, and setup out-of-the-box.
Keywords
Readme
📦 generator-automation-tests
A Yeoman generator for quickly scaffolding automation test projects. Supports Playwright and Selenium + Cucumber, with opinionated templates, configuration, and setup out-of-the-box.
🚀 Features
📂 Generates a structured automation test project
⚙️ Subgenerators for Playwright or Selenium + Cucumber
📝 Predefined templates for tests, configs, and workflows
📦 Auto-install of dependencies (npm / yarn)
🛠️ Easy to extend with additional subgenerators
📥 Installation
Install Yeoman globally if you don’t have it
npm install -g yoInstall Generator globally if you don’t have it
npm install -g @outliant/generator-automation-testsRun Generator
yo @outliant/automation-testsFollow the installation steps and start coding
🔧 Usage
Run the main generator:
yo automation-testsYou’ll be prompted to select a tool (e.g., Playwright or Selenium + Cucumber). The generator will then scaffold the project accordingly and optionally install dependencies.
🧩 Subgenerators
You can also call subgenerators directly:
Generate a Playwright project
yo automation-tests:playwrightGenerate a Selenium + Cucumber project
yo automation-tests:selenium-cucumber🗂️ Project Structure
Example after generation:
my-automation-project/
├── features/ Gherkin tests
├── step-definitions/ # Step definitions (Cucumber or Playwright)
├── pages/ # Page Object Model files
├── fixtures/ # Playwright fixtures
├── playwright.config.ts # Playwright config (if selected)
├── browserstack.yml # BrowserStack config
├── package.json
├── tsconfig.json
└── ...🛠️ Development
If you want to modify or extend the generator:
Link your local changes
npm link
Run the generator in a test folder
mkdir test-project && cd test-project
yo automation-tests
Debugging
Enable Yeoman debug logs:
DEBUG=yeoman:\* yo automation-tests
📜 Scripts
npm run lint # Run ESLint
npm test # Run tests➕ Addons
After choosing the main tool for your project, you can select a series of addons to be added to your project, this addons are encapsulated features that can help your project grow in scope for automation tests
This Node.js project audits website URLs using Google PageSpeed Insights API and Lighthouse CLI, logs the results (Performance, Accessibility, Best Practices, SEO), stores them in Google Sheets and Google Drive, and sends a formatted Slack notification upon completion.
🚀 Features
Input
- Accepts input via CSV file with a list of URLs
- Supports multiple environments:
SIT,UAT,PROD - Supports locale-based configuration:
US,INTL
Lighthouse Audit
Devices
- Desktop
- Mobile
Captured Metrics
- Performance
- Captured using PageSpeed API and CLI Lighthouse Audit
- Automation runs 5 times for consistency and picks the higher score
- Accessibility
- Captured using CLI Lighthouse Audit
- Best Practices
- Captured using CLI Lighthouse Audit
- SEO
- Captured using CLI Lighthouse Audit
Lighthouse Report
Reporting
- Automatically creates Google Spreadsheet template (formatting, tabs, headers, etc.)
- Uploads Lighthouse results to Google Spreadsheet after successful audit
- Automatically generates JSON file and uploads to Google Drive
Notifications
- Sends Slack message alerts with mentions and links
🗂️ Project Structure
LIGHTHOUSE-AUTOMATION/
│
├── utils/helpers/ # Utility scripts for Google Sheets and Drive operations
│ ├── create-spreadsheet.ts # Script to create a new Google Spreadsheet
│ ├── drive.ts # Handles Google Drive folder operations
│ ├── service-account.json # Google service account credentials
│ └── sheet.ts # Functions for reading/writing data to Google Sheets
│
├── links/ # CSV files containing URLs to audit for each environment
│ ├── prod-links.csv # Production environment URLs
│
├── results/ # Stores generated Lighthouse report files
│ └── (generated report files will go here)
│
├── lighthouse/ # Main automation scripts
│ ├── google-spreadsheets.ts # Script to push/pull data from Google Sheets
│ ├── lighthouse.ts # Runs Lighthouse audits (desktop/mobile)
│ └── slack.ts # Sends Slack notifications with results
│
├── config/ # Configuration file for environments, locales, and spreadsheet IDs
│ ├── lighthouse-config.ts
🧩 Setup
- Install dependencies:
npm install- Set up your
config.js:
module.exports = {
project_name: "Sample Project", // Update this based on the project you are executing
prod_spreadsheetId: "", // Will be automatically generated
sit_spreadsheetId: "", // Will be automatically generated
uat_spreadsheetId: "", // Will be automatically generated
google_drive_folderId: "", // Will be automatically generated
apiKey: "AIzaSyCyzH3l6l41F8wTafrFhQJjRdkmvsvSHD0", // Keep unchanged
slackWebhookUrl: "", // Add your valid Slack webhook URL here (Optional)
slackEnabled: true, // Enable Slack notifications (true or false)
};- Set up your
service account:
serviceAccountConfig: ServiceAccountConfig = {
type: "service_account",
project_id: process.env.PROJECT_LIGHTHOUSE_ID || "",
private_key_id: process.env.PRIVATE_LIGHTHOUSE_KEY_ID || "",
private_key: process.env.PRIVATE_LIGHTHOUSE_KEY || "",
client_email: process.env.PRIVATE_LIGHTHOUSE_CLIENT_EMAIL || "",
client_id: process.env.PRIVATE_LIGHTHOUSE_CLIENT_ID || "",
auth_uri: process.env.PRIVATE_LIGHTHOUSE_AUTH_URI || "",
token_uri: process.env.PRIVATE_LIGHTHOUSE_TOKEN_URI || "",
auth_provider_x509_cert_url:
process.env.PRIVATE_LIGHTHOUSE_AUTH_PROVIDER_CERT_URL || "",
client_x509_cert_url: process.env.PRIVATE_LIGHTHOUSE_CLIENT_CERT_URL || "",
universe_domain: process.env.PRIVATE_LIGHTHOUSE_UNIVERSE_DOMAIN || "",
};- Prepare your input CSVs under
/links/: Each line should follow the format:
Page Name,https://example.com/page-url🧪 Run Script
npm run lighthouse:<env>Examples:
npm run lighthouse:sit
npm run lighthouse:uat
npm run lighthouse:prod✅ Output
Google Sheet updated under respective tabs:
- Desktop - Performance
- Mobile - Performance
- Desktop - Accessibility
- Mobile - Accessibility
- Desktop - Best Practices
- Mobile - Best Practices
- Desktop - SEO
- Mobile - SEO
Slack message format:
:bar_chart: Lighthouse Updates:
Environment: PROD
Viewport: Desktop and Mobile
Date and Time: 07/16/2025 / 7:01 PM
Lighthouse Report: [Google Sheet Link](https://docs.google.com/spreadsheets/d/...)
File Resources: [Google Drive File Link](https://drive.google.com/drive/folders/...)
cc: @mentions🔗 Getting a Slack Webhook URL
Follow these steps to generate a slackWebhookUrl for sending automation notifications:
1. Create a Slack App
- Go to Slack API: Your Apps.
- Click Create New App.
- Choose From scratch and give your app a name (e.g.,
Lighthouse Automation Notifier). - Select the workspace where you want to send messages.
2. Enable Incoming Webhooks
- Inside your newly created app, navigate to Features > Incoming Webhooks.
- Toggle Activate Incoming Webhooks to On.
3. Create a Webhook
- Scroll down and click Add New Webhook to Workspace.
- Select the channel where you want automation messages to be sent (e.g.,
#automation-reports). - Click Allow.
- Copy the generated Webhook URL — it will look like this:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX---
4. Configure Your Project
- Open your project’s configuration file (
config.js). - Add your copied Webhook URL:
slackWebhookUrl="https://hooks.slack.com/services/xxx/yyy/zzz"📌 Notes
- Performance scores may vary depending on your network connectivity and device performance.
For consistent results, ensure you have a stable internet connection and sufficient system resources when running the audits.
🤝 Contributing
Fork the repo
Create a feature branch (git checkout -b feature/my-feature)
Commit changes (git commit -m 'feat: add selenium subgenerator')
Push to branch (git push origin feature/my-feature)
Open a Pull Request 🎉
