browse(function (Browser $browser) { // Login first $browser->driver->manage()->deleteAllCookies(); $browser->visit('http://dishplanner_app:8000/login') ->waitFor('input[id="email"]', 5) ->type('input[id="email"]', 'admin@test.com') ->type('input[id="password"]', 'password') ->press('Login') ->pause(2000) ->assertPathIs('/dashboard') // Navigate to Dishes and verify edit functionality exists ->clickLink('Dishes') ->pause(2000) ->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) { $browser->driver->manage()->deleteAllCookies(); $browser->visit('http://dishplanner_app:8000/login') ->waitFor('input[id="email"]', 5) ->type('input[id="email"]', 'admin@test.com') ->type('input[id="password"]', 'password') ->press('Login') ->pause(2000) ->clickLink('Dishes') ->pause(2000) ->assertSee('MANAGE DISHES') ->assertSee('Add Dish'); }); } public function testDishesPageStructure(): void { $this->browse(function (Browser $browser) { $browser->driver->manage()->deleteAllCookies(); $browser->visit('http://dishplanner_app:8000/login') ->waitFor('input[id="email"]', 5) ->type('input[id="email"]', 'admin@test.com') ->type('input[id="password"]', 'password') ->press('Login') ->pause(2000) ->clickLink('Dishes') ->pause(2000) ->assertSee('MANAGE DISHES') ->assertSee('Add Dish'); // Check that the dishes CRUD structure is present $pageSource = $browser->driver->getPageSource(); $this->assertStringContainsString('Edit', $pageSource); $this->assertStringContainsString('Delete', $pageSource); $this->assertStringContainsString('No dishes found', $pageSource); }); } }