npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@moizkhan/playwright-automation-framework

v1.0.1

Published

A comprehensive, configurable, and scalable Playwright test automation framework for merchant onboarding workflows

Readme

Generic Data-Driven Test Framework

A comprehensive, configurable, and scalable test automation framework for merchant onboarding workflows. This framework provides maximum flexibility to run different test scenarios with minimal configuration changes.

🚀 Quick Start

Run Different Test Suites

# Quick smoke test (5-10 minutes)
npm run test:smoke

# Complete regression test (30-45 minutes)
npm run test:regression

# Field validation focused test (20-30 minutes)
npm run test:validation

# MDR and payment channel test (15-20 minutes)
npm run test:mdr

# Performance test
npm run test:performance

Run with Browser Visible (Headed Mode)

npm run test:smoke:headed
npm run test:regression:headed
npm run test:validation:headed

Run on Different Environments

# Test on staging environment (default)
npm run test:staging

# Test on production environment
npm run test:production

# Test on local environment
npm run test:local

Test Different Business Scenarios

# Test individual small business scenario
npm run test:individual

# Test company medium business scenario (default)
npm run test:company

# Test enterprise large business scenario
npm run test:enterprise

🎯 Test Suite Options

| Suite | Description | Duration | Use Case | |-------|-------------|----------|----------| | smoke | Basic functionality validation | 5-10 min | Quick verification, CI/CD | | regression | Complete end-to-end testing | 30-45 min | Full regression testing | | validation | Field validation focus | 20-30 min | Input validation testing | | mdr_focused | MDR and payment channels | 15-20 min | Payment feature testing | | performance | Performance and load testing | 20-30 min | Performance validation | | custom | Configurable test suite | Variable | Custom scenarios |

🛠️ Advanced Usage

Command Line Interface

# Basic usage
node run-tests.js [test-suite] [options]

# Examples
node run-tests.js smoke
node run-tests.js regression --headed
node run-tests.js validation --env staging --data company
node run-tests.js mdr_focused --project chromium --workers 1

Available Options

| Option | Description | Values | |--------|-------------|--------| | --env | Set environment | staging, production, local | | --data | Set data scenario | individual, company, enterprise | | --headed | Show browser window | - | | --debug | Enable debug mode | - | | --project | Browser selection | chromium, firefox, webkit | | --workers | Parallel workers | number |

Direct Playwright Commands

# Run specific test files
npx playwright test Universal-TestRunner.spec.js
npx playwright test Generic-DataDriven.spec.js
npx playwright test Sequential-Complete.spec.js

# Run with specific configuration
TEST_SUITE=smoke npx playwright test Universal-TestRunner.spec.js --headed
TEST_SUITE=regression DATA_SCENARIO=enterprise npx playwright test Universal-TestRunner.spec.js

📊 Configuration

Test Suite Configuration

Edit config/testConfig.json to customize test behavior:

{
  "testSuites": {
    "your_custom_suite": {
      "description": "Your custom test description",
      "execution": {
        "mode": "sequential",
        "timeout": 300000,
        "continueOnError": true
      },
      "scenarios": {
        "validDataFlow": true,
        "invalidDataValidation": true,
        "mdrSplitTesting": true
      },
      "pages": {
        "basicInfo": true,
        "businessDetails": true,
        "mdrDetails": true
      }
    }
  }
}

Field Configuration

Edit config/testData.json to add new fields or validation rules:

{
  "pages": {
    "basicInfo": {
      "fields": [
        {
          "fieldName": "newField",
          "selector": "#newField",
          "type": "input",
          "validInputs": [
            {
              "value": "valid data",
              "description": "Valid input description"
            }
          ],
          "invalidInputs": [
            {
              "value": "",
              "expectedError": "Required field error",
              "description": "Empty field test"
            }
          ]
        }
      ]
    }
  }
}

🔧 Test Configuration Options

Execution Modes

  • Sequential: Tests run one after another (default)
  • Parallel: Tests run simultaneously (faster but requires more resources)
  • Single Page: Test only one page at a time

Scenario Types

  • validDataFlow: Test with valid data only
  • invalidDataValidation: Test field validation with invalid data
  • fieldByFieldTesting: Test each field individually
  • comprehensiveValidation: Complete validation testing
  • mdrSplitTesting: Test MDR split functionality
  • duplicateMerchantTesting: Test duplicate merchant handling
  • paymentChannelTesting: Test payment channel configuration

Page Selection

Enable/disable specific pages in your test run:

  • basicInfo: Basic merchant information
  • businessDetails: Business details and coordinates
  • proprietorDetails: Proprietor and contact information
  • bankingDetails: Banking and payment information
  • posSpecificDetails: POS-specific configurations
  • mdrDetails: MDR rates and configurations

📈 Test Data Scenarios

Business Type Scenarios

| Scenario | Business Type | Scale | Use Case | |----------|---------------|-------|----------| | individual | Individual | Small | Single person business | | company | Private Limited | Medium | Company business (default) | | enterprise | Public Limited | Large | Enterprise level business |

Custom Test Data

Generate custom test data by modifying utils/TestDataHelper.js:

export function generateCustomTestData(scenario) {
    const baseData = generateUniqueTestData();
    
    switch (scenario) {
        case 'high_volume':
            return {
                ...baseData,
                dailyTurnover: '1000000',
                mdrRates: { default: '1.5' }
            };
        case 'special_category':
            return {
                ...baseData,
                businessCategory: 'Custom Category'
            };
    }
}

📊 Reporting

Allure Reports

# Generate and view Allure report
npm run allure:serve

# Generate static report
npm run allure:generate
npm run allure:open

HTML Reports

# View Playwright HTML report
npx playwright show-report

Custom Reports

Test results are saved in multiple formats:

  • Allure: ./allure-results/ → Interactive reports
  • HTML: ./test-reports/report.html → Static HTML report
  • JSON: ./test-reports/results.json → Raw test data
  • Screenshots: ./screenshots/ → Error screenshots

🔍 Debugging

Debug Mode

# Run in debug mode with browser visible
node run-tests.js smoke --debug --headed

# Debug specific test
npx playwright test Universal-TestRunner.spec.js --debug

Error Investigation

  1. Check Screenshots: Error screenshots are automatically saved in ./screenshots/
  2. Review Logs: Detailed console output shows test progress
  3. Allure Report: Interactive reports with step-by-step execution
  4. Test Configuration: Verify config/testConfig.json settings

Common Issues

| Issue | Solution | |-------|----------| | Login fails | Check credentials in config/testConfig.json | | Field not found | Update selector in config/testData.json | | Timeout errors | Increase timeout in test configuration | | Validation fails | Check expected error messages |

🚀 CI/CD Integration

GitHub Actions

name: Test Automation
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
      - run: npm install
      - run: npx playwright install
      - run: npm run test:smoke
      - run: npm run allure:generate

Jenkins

pipeline {
    agent any
    stages {
        stage('Test') {
            steps {
                sh 'npm install'
                sh 'npx playwright install'
                sh 'npm run test:regression'
            }
        }
        stage('Report') {
            steps {
                sh 'npm run allure:generate'
                publishHTML([
                    allowMissing: false,
                    alwaysLinkToLastBuild: true,
                    keepAll: true,
                    reportDir: 'allure-report',
                    reportFiles: 'index.html',
                    reportName: 'Test Report'
                ])
            }
        }
    }
}

🛡️ Best Practices

Test Organization

  1. Use appropriate test suite for your needs (smoke for quick validation, regression for comprehensive testing)
  2. Configure environments properly in config/testConfig.json
  3. Customize test data scenarios for different business types
  4. Enable error handling with continueOnError: true for comprehensive test runs

Performance

  1. Use parallel execution for faster test runs when possible
  2. Optimize selectors for better reliability
  3. Reduce timeouts for faster feedback in development
  4. Disable screenshots in performance tests

Maintenance

  1. Update selectors in config/testData.json when UI changes
  2. Add new validation rules as business rules evolve
  3. Keep test data fresh with unique generation
  4. Monitor test execution times and optimize slow tests

📚 Examples

Custom Test Suite

# Create a custom test for specific scenario
TEST_SUITE=custom DATA_SCENARIO=individual npx playwright test Universal-TestRunner.spec.js --headed

Environment-Specific Testing

# Test on staging with enterprise data
node run-tests.js regression --env staging --data enterprise --headed

Quick Validation

# Quick field validation test
npm run test:validation:headed

Performance Testing

# Run performance tests without screenshots
node run-tests.js performance --workers 3

🤝 Contributing

  1. Add new test scenarios by extending config/testConfig.json
  2. Add new field configurations in config/testData.json
  3. Create new test data scenarios in utils/GenericTestHelper.js
  4. Document new features in this README

📞 Support

For issues and questions:

  1. Check the Common Issues section above
  2. Review test logs and screenshots
  3. Verify configuration files
  4. Check Allure reports for detailed execution information

This framework provides maximum flexibility for testing merchant onboarding workflows with minimal configuration changes. Choose the appropriate test suite for your needs and customize as required.