I am working on my first DUSK (which is based on PHPUnit) tests. I am creating a customer and going to their show page. The UUID is created upon save in the database, and is used as part of the route from that point on. Routes can handle unknown uuid because they have a wildcard syntax.
Route::get('/customer/{uuid}/show', 'App\Http\Controllers\CustomerController@show')->name('customer.show');
Does PHPUnit/DUSK have something similar?
This is what I have tired but the assert fails.
...
->press('NEW CUSTOMER')
->waitForLocation('/customer/create')
->type('first_name', 'John')
->type('last_name', 'Doe')
->type('date_of_birth', '03/03/1933')
->press('SAVE')
->waitForLocation('/customer/{uuid}/show')
->assertPathIs('/customer/{uuid}/show');
TLDR: Does PHPUnit allow wildcards in route assertions?
How do you suppose it to work? Client have to know the UUID in some way. There are 3 options: