browse(function (Browser $browser) { $this->loginAndGoToDishes($browser); // Check that Livewire component includes all CRUD features $pageSource = $browser->driver->getPageSource(); $this->assertStringContainsString('MANAGE DISHES', $pageSource); $this->assertStringContainsString('Add Dish', $pageSource); // Either we have dishes with Delete button OR "No dishes found" message if (str_contains($pageSource, 'No dishes found')) { $this->assertStringContainsString('No dishes found', $pageSource); } else { $this->assertStringContainsString('Delete', $pageSource); } }); } }