pestphp / pestphp/pest

[Bug]: Browser test not running with ./vendor/bin/pest command

Open
#1,853 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
11.7k
Forks
538
Avg merge
4d 11h
Merged PRs (30d)
8

Description

What Happened

After I am installing pest using below commands

composer require pestphp/pest-plugin-browser --dev
npm install playwright@latest
npx playwright install

and create a Browser test directory in the /tests in the root of my project
and actually create an exampleTest.php in it and change my /test/Pest.php file to this

pest()->extend(TestCase::class)
->use(RefreshDatabase::class)
->in('Browser', 'Unit');

alsomy laravel project is running
php artisan ser

When I enter ./vendor/bin/pest command it wasn't run my Browser tests at all!
But Unit tests was running normally.

Browser tests can run with this command normally ./vendor/bin/pest tests/Browser

How to Reproduce

1- install pest
composer require pestphp/pest-plugin-browser --dev
npm install playwright@latest
npx playwright install

  1. change /test/Pest.php file contents to this (line18 ,19)

pest()->extend(TestCase::class)
->use(RefreshDatabase::class)
->in('Browser', 'Unit');

  1. make sure that laravel project is running
    php artisan ser

  2. Enter ./vendor/bin/pest command

Sample Repository

No response

Pest Version

5.0

PHP Version

8.3

Operation System

Windows

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the test/Pest.php configuration and the tests/Browser directory described in the report. Run ./vendor/bin/pest and then ./vendor/bin/pest tests/Browser in the provided setup, comparing which tests are discovered; done means the default command includes the Browser tests while Unit tests continue to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php, playwright
Domain
cli, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.