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"
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?