We have an action to edit the user profile that is redirected to the same page. Here seePageIs () does not seem to be waiting for a new page to load.
The following test fails because the new username was not found in the response. When we load the profile page manually after the test, it was correctly updated.
public function testCanEditUserProfileAsConsumer() { $this->loginConsumer(); $this->visit('/user/profile'); $firstName = $this->faker->firstname; $name = $this->faker->name; $this->within('#userEditForm', function() use ($firstName, $name) { $this->type($firstName, 'firstname'); $this->type($name, 'surname'); $this->press('Speichern'); });
change
$this->within('#userEditForm', function() use ($firstName, $lastname) { $this->type($firstName, 'firstname'); $this->type($lastname, 'surname'); $this->press('Speichern') ->seePageIs('/user/profile') ->see($firstName) ->see($lastname); });
also does not work
php testing laravel
Alex
source share