3 months ago

Dusk runs web.php multiple times

Posted 3 months ago by cristimocean

I am just learning Dusk, and I have a problem: I cannot run more than one test at a time. If I try to run 2 tests I get an error about const version being already defined in web.php. How can I run 2 tests and bypass this error ?

I run this with php artisan dusk --group setup

Here's my code:


namespace Tests\Browser;

use App\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

class SetupTest extends DuskTestCase
    use DatabaseMigrations;

    public function setUp():void


    /** @test
     * @group can_login
     * @group setup
    public function can_login()
        $this->browse(function (Browser $browser) {
            $member = factory(User::class)->create();

     * @test
     * @group can_connect_to_database
     * @group setup
    public function can_connect_to_database()
        DB::statement('CREATE TABLE dummy (id int, name varchar(255))');
        $data = ['id' => 1, 'name' => 'lalala'];
        $this->assertDatabaseHas('dummy', ['name' => 'lalala']);


Please sign in or create an account to participate in this conversation.