Skip to content

danbao/testring

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1,410 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

testring

license npm Node.js CI Coverage Maintainability Rating

A simple, powerful automated UI testing framework based on Node.js.

Project Overview

testring is a modern testing framework specifically designed for automated testing of web applications. It provides:

  • ๐Ÿš€ High Performance - Multi-process parallel test execution
  • ๐Ÿ”ง Extensible - Rich plugin system architecture
  • ๐ŸŒ Multi-Browser - Support for Chrome, Firefox, Safari, Edge
  • ๐Ÿ“ฑ Modern - Support for both Selenium and Playwright drivers
  • ๐Ÿ› ๏ธ Developer Friendly - Complete development toolchain

Project Structure

testring/
โ”œโ”€โ”€ core/              # Core modules - Framework foundation
โ”‚   โ”œโ”€โ”€ api/           # Test API controllers
โ”‚   โ”œโ”€โ”€ cli/           # Command line interface
โ”‚   โ”œโ”€โ”€ logger/        # Distributed logging system
โ”‚   โ”œโ”€โ”€ transport/     # Inter-process communication
โ”‚   โ”œโ”€โ”€ test-worker/   # Test worker processes
โ”‚   โ””โ”€โ”€ ...           # Other core modules
โ”œโ”€โ”€ packages/          # Extension packages - Plugins and tools
โ”‚   โ”œโ”€โ”€ plugin-selenium-driver/    # Selenium driver plugin
โ”‚   โ”œโ”€โ”€ plugin-playwright-driver/  # Playwright driver plugin
โ”‚   โ”œโ”€โ”€ web-application/           # Web application testing
โ”‚   โ”œโ”€โ”€ devtool-frontend/          # Developer tools frontend
โ”‚   โ””โ”€โ”€ ...                       # Other extension packages
โ”œโ”€โ”€ docs/              # Documentation directory
โ”œโ”€โ”€ utils/             # Build and maintenance tools
โ””โ”€โ”€ README.md          # Project documentation

Core Modules (core/)

Core modules provide the framework's foundational functionality:

  • API Layer - Test execution and control interfaces
  • CLI Tools - Command line interface and argument processing
  • Process Management - Multi-process test execution and communication
  • File System - Test file discovery and reading
  • Logging System - Distributed logging and management
  • Plugin System - Extensible plugin architecture

Extension Packages (packages/)

Extension packages provide additional functionality and tools:

  • Browser Drivers - Selenium and Playwright support
  • Web Testing - Web application-specific testing features
  • Developer Tools - Debugging and monitoring tools
  • Network Communication - WebSocket and HTTP support
  • File Handling - File upload, download, and storage

Quick Start

Installation

# Install the main framework
npm install testring

# Install Selenium driver (recommended)
npm install @testring/plugin-selenium-driver

# Or install Playwright driver
npm install @testring/plugin-playwright-driver

Basic Configuration

Create a .testringrc configuration file:

{
  "tests": "./tests/**/*.spec.js",
  "plugins": [
    "@testring/plugin-selenium-driver"
  ],
  "workerLimit": 2,
  "retryCount": 3
}

Writing Tests

// tests/example.spec.js
describe('Example Test', () => {
  it('should be able to access the homepage', async () => {
    await browser.url('https://example.com');

    const title = await browser.getTitle();
    expect(title).toBe('Example Domain');
  });
});

Running Tests

# Run all tests
testring run

# Run specific tests
testring run --tests "./tests/login.spec.js"

# Set parallel execution
testring run --workerLimit 4

# Debug mode
testring run --logLevel debug

Documentation

For detailed documentation, please refer to:

Key Features

Multi-Process Parallel Execution

  • Support for running multiple tests simultaneously
  • Process isolation to prevent test interference
  • Intelligent load balancing

Multi-Browser Support

  • Chrome, Firefox, Safari, Edge
  • Headless mode support
  • Mobile browser testing

Plugin System

  • Rich official plugins
  • Simple plugin development API
  • Community plugin support

Development Tools

  • Visual debugging interface
  • Real-time test monitoring
  • Detailed test reports

Development

Project Setup

# Clone the project
git clone https://github.com/ringcentral/testring.git

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the project
  2. Create a feature branch
  3. Submit your changes
  4. Create a Pull Request

License

MIT License - See the LICENSE file for details.

Support

๐ŸŒ Cloudflare Worker for Test Fixtures

่ฟ™ไธช้กน็›ฎๅŒ…ๅซไธ€ไธช็‹ฌ็ซ‹็š„ Cloudflare Worker๏ผŒๆไพ›ๅœจ็บฟๆต‹่ฏ•็Žฏๅขƒ๏ผš

cloudflare-worker/
โ”œโ”€โ”€ build.js          # ๆž„ๅปบ่„šๆœฌ
โ”œโ”€โ”€ wrangler.toml      # Worker ้…็ฝฎ
โ”œโ”€โ”€ package.json       # ไพ่ต–็ฎก็†
โ”œโ”€โ”€ static-fixtures/   # ๆต‹่ฏ•้กต้ขๆบๆ–‡ไปถ (24ไธช)
โ”œโ”€โ”€ worker.js          # ็”Ÿๆˆ็š„ไปฃ็  (gitignored)
โ””โ”€โ”€ README.md          # ่ฏฆ็ป†ๆ–‡ๆกฃ

ๅฟซ้€Ÿๅผ€ๅง‹

cd cloudflare-worker
npm install
npm run build
npm run deploy

่ฏฆ็ป†ไฟกๆฏ่ฏทๆŸฅ็œ‹ cloudflare-worker/README.md

About

RingCentral TestRing

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • TypeScript 82.2%
  • JavaScript 15.8%
  • HTML 1.7%
  • Other 0.3%