..need help on Form Wizard Pest Test With Each Step Form Validation

I have a custom page which extends
use Filament\Pages\Page;
use Filament\Pages\Page;
now in this page I use
use Filament\Pages\Concerns\InteractsWithFormActions;
use Filament\Pages\Concerns\InteractsWithFormActions;
as trait and use this page for form. in form schema I have wizard with 3 steps. How I can call wizard next and previous steps that I can test form validation with pest test. Example:-
livewire(ProfileSetup::class)
->fillForm([
'field_name' => 'field_value',
'second_field_name' => [
'child_field' => null,
'child_field' => 'some_value',
],
])
->call('') // here I want to call form wizard next and previous step action button
->assertHasNoFormErrors()
livewire(ProfileSetup::class)
->fillForm([
'field_name' => 'field_value',
'second_field_name' => [
'child_field' => null,
'child_field' => 'some_value',
],
])
->call('') // here I want to call form wizard next and previous step action button
->assertHasNoFormErrors()
In wizard I have step like this..
Wizard\Step::make('Information')
->columns(2)
->statePath('custom_data')
->model(fn () => $this->customModel ?? CustomModel::class)
->afterValidation(function () {
if (! $this->disableForm) {
$this->saveFirstStepInfo();
}
})
->schema($this->getFirstStepFormSchema()),
Wizard\Step::make('Information')
->columns(2)
->statePath('custom_data')
->model(fn () => $this->customModel ?? CustomModel::class)
->afterValidation(function () {
if (! $this->disableForm) {
$this->saveFirstStepInfo();
}
})
->schema($this->getFirstStepFormSchema()),
like this I have total three steps, how test wizard form with step by step form validation
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?