browse(function (Browser $browser) { $this->loginAndGoToDishes($browser) ->assertPathIs('/dishes') ->assertSee('MANAGE DISHES'); // Verify that edit functionality is available by looking for the text in the page source $pageSource = $browser->driver->getPageSource(); $this->assertStringContainsString('Edit', $pageSource); }); } public function testEditModalComponents(): void { $this->browse(function (Browser $browser) { $this->loginAndGoToDishes($browser) ->assertSee('MANAGE DISHES') ->assertSee('Add Dish'); }); } public function testDishesPageStructure(): void { $this->browse(function (Browser $browser) { $this->loginAndGoToDishes($browser) ->assertSee('MANAGE DISHES') ->assertSee('Add Dish'); // Check that the dishes CRUD structure is present $pageSource = $browser->driver->getPageSource(); // Either we have dishes with Edit/Delete buttons OR "No dishes found" message if (str_contains($pageSource, 'No dishes found')) { $this->assertStringContainsString('No dishes found', $pageSource); } else { $this->assertStringContainsString('Edit', $pageSource); $this->assertStringContainsString('Delete', $pageSource); } }); } }