@outliant/generator-automation-tests
v1.0.2
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.
Ensures websites detect and respect user privacy preferences (Global Privacy Control) automatically signaled by the browser across multiple geolocations via BrowserStack.
🚀 Features
- Tests GPC signal handling for US states (CA, GA, VA) and international (AU, DE)
- Runs Cucumber.js feature tests via BrowserStack Automate
- Uses geolocation IP simulation to verify location-specific privacy behavior
- BrowserStack dashboard link serves as the test report
🧩 Setup
- Update
gpc/links.csvwith pages to test (column:url) - Update
gpc/browserstack.configwith your project'sbuildName - Set
BROWSERSTACK_USERNAMEandBROWSERSTACK_ACCESS_KEYin.env
🧪 Run
npm run gpc:all # All geolocations
npm run gpc:us-states # US states only (CA, GA, VA)
npm run gpc:intl # International only (AU, DE)
npm run gpc:us-ca # California only
npm run gpc:intl-au # Australia onlyCrawls URLs from CSV files, parses JSON-LD and Microdata structured data, compares schema with meta tags, and generates HTML, PDF, and CSV reports.
🚀 Features
- Detects JSON-LD and Microdata structured data
- Compares schema title/description/H1 against meta tags
- Optional Google Rich Results validation (requires
PSI_API_KEY) - Outputs reports to
schema/reports/
🧩 Setup
- Add your URLs to
schema/resources/vanityUrls.csv - (Optional) Set
PSI_API_KEYin.envfor rich-result validation - Configure
schema/gitActions/gitConfig.conffor GitHub upload settings
🧪 Run
# Validate structured data
npm run schema:structure -- "https://yoursite.com"
# Validate rich results (requires PSI_API_KEY)
npm run schema:rich-result -- "https://yoursite.com"
# Compare meta tags with schema
npm run schema:meta-content-check -- "https://yoursite.com"Imports text content from live web pages (desktop & mobile), generates Excel reports, and validates current content against previously imported baseline data.
🚀 Features
- Imports text from pages defined in
content-checker/resources/vanityUrls.csv - Generates structured Excel reports under
content-checker/reports/ - Validates content against baseline and uploads reports to GitHub
🧩 Setup
- Add your vanity URLs to
content-checker/resources/vanityUrls.csv - Configure
content-checker/config.conffor desktop/mobile view and GitHub settings - Set
GIT_ACCESS_TOKENin.env
🧪 Run
# Import baseline data
npm run text-import -- "https://yoursite.com"
# Validate current content against baseline
npm run text-content-check -- "https://yoursite.com"Scans pages defined in an Excel file using axe-core (via Playwright) and Pa11y, and generates HTML accessibility reports organized by environment and timestamp.
🚀 Features
- Reads URLs from
accessibility/urls.xlsx(one sheet per environment: DEV, SIT, UAT, PROD) - Generates axe-core HTML reports and Pa11y HTML reports
- Reports saved to
accessibility/accessibility-reports/<ENV>/<timestamp>/
🗂️ Input File Format (urls.xlsx)
Each sheet is named DEV / SIT / UAT / PROD with columns: Page Name | Link
🧪 Run
npm run accessibility:dev
npm run accessibility:sit
npm run accessibility:uat
npm run accessibility:prodReads expected SEO data from an Excel file, visits each URL with Playwright/Chromium, compares actual page titles and meta descriptions, and outputs a styled Excel report.
🚀 Features
- Reads input from
meta-checker/seo_data.xlsx - Compares
<title>and meta description for each URL - Generates
meta-checker/seo_results.xlsxwith green (MATCHED) / red (MISMATCHED) cells
🗂️ Input File Format (seo_data.xlsx)
Column A: URL | Column B: Expected Title | Column C: Expected Meta Description
🧪 Run
npm run meta:checkChecks a list of URLs from a CSV file, detects HTTP status codes and redirections, and generates a color-coded Excel report.
🚀 Features
- Checks URLs from
page-access/links.csv - Detects status codes, redirections, timeouts, DNS errors
- Generates
page-access/page-access-result.xlsxwith color-coded rows
🗂️ Project Structure
page-access/
├── index.ts # Main script
└── links.csv # Input URLs (one per line: url)🧩 Setup
- Add your URLs to
page-access/links.csv:
url
https://example.com
https://google.com🧪 Run
npm run page-access:check🤝 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 🎉
