Laravel Dusk says Class ‘TestsBrowserComponents…’ could not be found

After I installed laravel-dusk following the official Laravel documentation and run this command:

php artisan make:component CardComponentTest

Then try to run immediately:

php artisan dusk tests/Browser/Components/CardComponentTest.php

I get this error:

Class 'TestsBrowserComponentsCardComponentTest' could not be found in '/var/www/html/tests/Browser/Components/CardComponentTest.php'.

I tested file and path are correct:

ls -l /var/www/html/tests/Browser/Components/CardComponentTest.php

And it says:

-rw-r--r-- 1 djw djw 6917 Dec  3 11:25 /var/www/html/tests/Browser/Components/CardComponentTest.php

So it is exists and readable.

I checked the namespace in the file:

<?php

namespace TestsBrowserComponents;

It also looks good.

I checked the composer.json and in this I have this section:

    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },

So the file exists, the namespace is good and the namespace is picked up in the composer.json.

I tried to run composer dump-autoload too. All good.

Any ide what’s wrong whit this?