© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•5mo ago•
1 reply
CerealKiller

Filament v4 testing with Pest

Hi all, how can I add data-test attributes to elements I want to test out? I would like to assert some things on the elements such as tables, widgets.. etc

    $page->assertSeeIn('body > div.fi-layout > div.fi-main-ctn > main > div > div > div > div > div:nth-child(1) > div > div > div > div > div > div > div > div > div > section > div > div > div:nth-child(1) > div > div > div > div.fi-wi-stats-overview-stat-value', number_format($totalTributes, thousands_separator: '.'));
    $page->assertSeeIn('body > div.fi-layout > div.fi-main-ctn > main > div > div > div > div > div:nth-child(1) > div > div > div > div > div > div > div > div > div > section > div > div > div:nth-child(1) > div > div > div > div.fi-wi-stats-overview-stat-value', number_format($totalTributes, thousands_separator: '.'));


I would like to avoid this giant selector with something like @totalTributes -> data-test="totalTributes"
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

testing uploads with Pest
FilamentFFilament / ❓┊help
3y ago
Filament form with laravel pest.
FilamentFFilament / ❓┊help
3y ago
testing panels in pest?
FilamentFFilament / ❓┊help
3y ago
Filament v3 to v4 upgrade testing issues
FilamentFFilament / ❓┊help
2mo ago