Download the PHP package valcuandrei/pest-e2e without Composer

On this page you can find all versions of the php package valcuandrei/pest-e2e. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pest-e2e

Write Pest tests. Run real browser E2E tests. Keep everything inside your Laravel test suite.

pestE2E is a Laravel-first bridge between Pest and JavaScript-native browser testing.

Laravel owns your test intent, state, authentication, fixtures, and assertions. JavaScript owns the browser. pestE2E connects the two and maps structured browser results back into normal Pest output.

No PHP browser DSL. No Playwright wrapper. No separate frontend-only testing workflow.


How It Works

  1. Write a Pest test in PHP.
  2. Pass authentication, parameters, and context to your JavaScript test runner.
  3. Run real browser tests with Playwright.
  4. Report structured results back into Pest.

Example

Pest

Playwright

Laravel controls state and authentication. JavaScript controls the browser.


Why pestE2E Exists

Pest is excellent for Laravel tests. Playwright is excellent for browser tests.

pestE2E lets you use both without pretending one is the other.

It is designed for applications where the browser matters:

pestE2E does not hide Playwright behind PHP methods. It lets Laravel orchestrate your browser suite while JavaScript keeps full ownership of browser automation.


Key Features


What This Is Not

pestE2E is not:

All browser logic stays in JavaScript.


Status

Stable v1

The public PHP API, authentication contract, and JSON report schema are locked. Internal runner adapters may evolve.


Installation

Install the package:

Then run the installer:

For unattended setup:

Alias:

The installer can:

Each step is skipped if already done.


Installer Options

Option Description
--yes Answer yes to all questions and perform full setup
--unattended Alias for --yes
--no Answer no to all questions
--force Overwrite existing files when publishing
--update-pest Update Pest config to include E2ETestCase
--setup-env-testing Create .env.testing with parallel-safe E2E overrides
--update-testing-env Patch an existing .env.testing with parallel-safe session/cache/queue settings
--setup-testing-database Create database/testing.sqlite for projects that intentionally use SQLite
--configure-phpunit Comment out DB/cache env values in phpunit.xml so .env.testing controls them
--sail-wslg-headed Merge WSLg display/volume settings into the Sail laravel.test service
--add-csrf-exclusion Add the pestE2E auth route to CSRF exclusions
--publish-config Publish config
--publish-base-test-case Publish E2ETestCase
--publish-js-harness Publish JS harness
--publish-js-playwright Publish Playwright adapter
--publish-browser-tests Publish browser tests
--publish-playwright-tests Publish Playwright tests
--install-playwright Install @playwright/test and run playwright install
--package-manager= Force the package manager used for E2E runs: npm, yarn, pnpm, or bun

When publishing E2ETestCase, the installer resolves the package manager from tools found on your PATH in this priority order:

If multiple tools are available, interactive installs prompt you to choose. With --yes / --unattended, the installer prefers a manager matching an existing lockfile, then falls back to the priority order. If none are found on PATH, it uses lockfile-only detection, then falls back to npm.

Pass --package-manager=pnpm, --package-manager=yarn, --package-manager=bun, or --package-manager=npm to force the value.


Testing Environment

pestE2E starts a managed Laravel server using:

If .env.testing exists, Laravel loads it automatically.

The installer can create this file with --setup-env-testing or update an existing one with --update-testing-env.

Recommended .env.testing values for Sail-compatible MySQL:

These values ensure:

Your phpunit.xml should not override DB_CONNECTION, DB_DATABASE, CACHE_STORE, or SESSION_DRIVER. Let .env.testing control them.

The installer can comment those overrides out for you with:


Parallel Testing

Browser tests that call e2e()->...->run() can run with Pest / Laravel parallel testing:

For first-time database bootstrapping, run:

Use a real test database such as MySQL or PostgreSQL. Laravel parallel testing creates one database per worker:

SQLite is not recommended for parallel browser testing because it does not provide the same per-worker database isolation model.

Each Pest worker gets:

Default port formula when server.parallel_port_offset is enabled:

Example with base port 8800:

Serial runs keep using an ephemeral free port.

Configure the base port with:

Legacy env is also supported:

You can also configure this in config/pest-e2e.php under server.port.


Quick Start

Configure a target in tests/E2ETestCase.php inside setUp():

Register targets in your base E2E test case, not inside individual test functions.

Run all tests for a target:

Run a specific JS test:

Pass parameters:

Authenticate as a Laravel user:

actingAs() and loginAs() are both supported.


Managed Testing Server

When you call:

pestE2E automatically:

  1. boots a temporary Laravel HTTP server
  2. forces it into APP_ENV=testing
  3. binds it to 127.0.0.1
  4. chooses a free port for serial runs, or a worker-specific port for parallel runs
  5. executes your JS runner against that server
  6. collects the JSON report
  7. shuts the server down

No manual php artisan serve required.


Running Tests

Local:

Laravel Sail:

Parallel:

Successful E2E detail output is shown in normal test runs.

In --compact and --parallel runs, passed E2E details are suppressed so Pest output stays readable. Failed E2E runs still print their details.


Agent / PAO Output

For AI agents and CI parsers, enable compact JSON output. This emits one line per e2e()->run():

You can also enable it with the CLI flag:

Agent output is also auto-detected when laravel/agent-detector is installed or common agent env vars are set, such as:

Configure it with:

Or in config/pest-e2e.php:

Disable it with:

In agent mode, human-readable Pest output is suppressed. Failed runs include:

See .docs/API.md for the full JSON contract.


Debug & Headed Mode

The default package manager is set in E2ETestCase::$e2ePackageManager during install.


Timing Instrumentation

Enable baseline timing markers:

Markers are emitted to stderr with this prefix:

Each marker is a JSON payload with:


Headed Mode in Sail

If you run Pest inside Laravel Sail on Windows WSL2 and want headed browser mode, forward WSLg into the container by adding this to your laravel.test service:

This is only required for headed browser mode inside Docker on WSL2. Headless mode works without additional configuration.


Authentication Contract

Default auth route:

Configure it with:

Security:


Reports & Artifacts

Playwright emits its JSON report to stdout. The PHP side parses it in memory and maps it to the canonical pest-e2e.v1 schema.

Playwright artifacts are written to a run-scoped directory:

The default base directory is:

Configure it with:

Old run directories are pruned according to reports.prune. Only directories marked as pestE2E runs are deleted, and the current run directory is never pruned.


Configuration

Key config keys in config/pest-e2e.php:

Key Description
auth.route Auth endpoint path. Default: /pest-e2e/auth/login
auth.route_enabled Enable auth route. Default: false, set via PEST_E2E_AUTH_ROUTE_ENABLED
auth.ttl_seconds Auth ticket TTL. Default: 60
auth.header.name / auth.header.value Header required for auth requests. Default: X-Pest-E2E: 1
server.driver Server runner: artisan or php_builtin. Default: php_builtin
server.host Bind address for the managed server. Default: 127.0.0.1
server.port Base HTTP port for parallel workers. Default: 8800
server.parallel_port_offset Parallel workers use server.port + TEST_TOKEN. Default: true
reports.base_dir Base directory for Playwright artifacts. Default: storage/framework/testing/pest-e2e
reports.prune.enabled Enable old run pruning. Default: true
reports.prune.keep_runs Number of most recent marked runs to keep. Default: 50
reports.prune.keep_days Age window for marked runs to keep. Default: 7
timing.enabled Enable timing instrumentation. Default: false, set via PEST_E2E_TIMING
js_runner.driver JS runner. Default: playwright
js_runner.mode Runner mode: cold or warm. Default: cold
package_manager Package manager for E2E runs: npm, yarn, pnpm, or bun
parallel.base_port Deprecated alias for server.port
agent_output Force agent JSON output. Default: from PEST_E2E_AGENT_OUTPUT / PAO_FORCE
bindings Contract-to-implementation map for swapping the JS runner

Runner Swapping

pestE2E uses contracts for the JavaScript worker and JSON parser.

The default bindings use Playwright, but you can override them in config/pest-e2e.php to integrate another runner, such as Cypress or Puppeteer.

The important boundary stays the same:


Final Positioning

pestE2E is not “browser testing for Laravel.”

It is a contract-driven bridge between Laravel and JavaScript-native E2E systems.

If you are building advanced frontend applications and want Laravel to orchestrate while JavaScript owns the browser, this package is for you.


All versions of pest-e2e with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/support Version ^13.0
laravel/prompts Version ^0.3
symfony/process Version ^8.0
symfony/yaml Version ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package valcuandrei/pest-e2e contains the following files

Loading the files please wait ...