PHPackages                             austinw/pest-plugin-browser-recording - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. austinw/pest-plugin-browser-recording

ActiveLibrary[Testing &amp; Quality](/categories/testing)

austinw/pest-plugin-browser-recording
=====================================

Interactive browser test recording for Pest - record user actions and automatically generate Pest test code

4349[1 issues](https://github.com/AustinW/pest-plugin-browser-recording/issues)PHPCI failing

Since Sep 6Pushed 8mo agoCompare

[ Source](https://github.com/AustinW/pest-plugin-browser-recording)[ Packagist](https://packagist.org/packages/austinw/pest-plugin-browser-recording)[ RSS](/packages/austinw-pest-plugin-browser-recording/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Pest Plugin Browser Recording
=============================

[](#pest-plugin-browser-recording)

**Interactive browser test recording for Pest v4** - Record user actions and automatically generate clean, maintainable Pest test code.

[![Tests](https://github.com/AustinW/pest-plugin-browser-recording/actions/workflows/tests.yml/badge.svg)](https://github.com/AustinW/pest-plugin-browser-recording/actions/workflows/tests.yml)

✨ Overview
----------

[](#-overview)

This plugin extends Pest's browser testing capabilities with **interactive recording**, allowing you to perform manual browser actions and automatically generate corresponding Pest test code. Perfect for:

- **Rapid test creation** from manual testing workflows
- **Complex user journey testing** with real browser interactions
- **Cross-browser compatibility testing** with device emulation
- **Accessibility testing** with ARIA-aware selector generation

🚀 Quick Start
-------------

[](#-quick-start)

### Installation

[](#installation)

```
composer require austinw/pest-plugin-browser-recording --dev
```

### Requirements

[](#requirements)

- **PHP**: ^8.2
- **Pest**: ^4.0
- **Pest Browser Plugin**: ^4.0
- **Playwright**: Installed via `php artisan pest:install-browser`

### Basic Usage

[](#basic-usage)

```
it('can complete user registration', function() {
    $page = visit('/register')
        ->record([
            'timeout' => 3600,
            'autoAssertions' => true,
            'generateComments' => true
        ]);

    // 🎬 Browser opens - perform your actions manually
    // ✨ Code is automatically generated and injected here

    // Example generated output:
    // $page->type('#email', 'user@example.com')
    //     ->type('#password', 'secure123')
    //     ->click('#register-button')
    //     ->assertUrlContains('/dashboard')
    //     ->assertNoJavascriptErrors();
});
```

📖 Documentation
---------------

[](#-documentation)

### Core Features

[](#core-features)

#### 🎯 Smart Selector Generation

[](#-smart-selector-generation)

Automatically generates stable, maintainable selectors with intelligent prioritization:

```
// Priority: data-testid > id > name > class > hierarchy
'[data-testid="submit-button"]'  // Highest priority - test-stable
'#email-field'                   // ID-based - reliable
'[name="user_email"]'            // Name-based - form-friendly
'button.btn.btn-primary'         // Class-based - styling-aware
'form > div:nth-child(2) > input' // Hierarchical - fallback
```

#### ⚙️ Flexible Configuration

[](#️-flexible-configuration)

**Global Configuration** (`config/recording.php`):

```
