© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago
Krishzzi

..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
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Wizard step validation
FilamentFFilament / ❓┊help
2y ago
Form Wizard save to db on each step
FilamentFFilament / ❓┊help
3y ago
Saving Wizard Form Contents at Each Step
FilamentFFilament / ❓┊help
3y ago
Wizard with each step from different model?
FilamentFFilament / ❓┊help
3y ago