From 2d6ef13a0be080916a1825a1899332304f899bd3 Mon Sep 17 00:00:00 2001 From: William Allen Date: Tue, 7 Jul 2026 13:51:26 -0400 Subject: [PATCH] Fix flaky profile page test The profile page browser test fails roughly 7% of the time based on historical CDash data. This is likely caused by assertions running prior to Vue finishing the initial render. This PR addresses the issue by waiting for input fields prior to making assertions. --- tests/Browser/Pages/ProfilePageTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Browser/Pages/ProfilePageTest.php b/tests/Browser/Pages/ProfilePageTest.php index c22d5aaba4..989f656cf4 100644 --- a/tests/Browser/Pages/ProfilePageTest.php +++ b/tests/Browser/Pages/ProfilePageTest.php @@ -61,6 +61,7 @@ public function testCanChangeNameAndEmail(): void $this->browse(function (Browser $browser): void { $browser->loginAs($this->users['admin']) ->visit('/profile') + ->waitFor('@fname-input') ->assertInputValue('@fname-input', 'admin') ->assertInputValue('@lname-input', 'admin') ->assertInputValue('@email-input', 'admin@example.com') @@ -85,6 +86,7 @@ public function testCanChangeNameAndEmail(): void $browser->logout() ->loginAs($user) ->visit('/profile') + ->waitFor('@fname-input') ->assertInputValue('@fname-input', 'first name here') ->clear('@fname-input') @@ -109,6 +111,7 @@ public function testCanChangeNameAndEmail(): void $browser->logout() ->loginAs($user) ->visit('/profile') + ->waitFor('@fname-input') ->assertInputValue('@fname-input', 'admin') ->assertInputValue('@lname-input', 'admin') ->assertInputValue('@email-input', 'admin@example.com') @@ -123,6 +126,7 @@ public function testIncorrectPasswordPreventsPasswordReset(): void $this->browse(function (Browser $browser): void { $browser->loginAs($this->users['admin']) ->visit('/profile') + ->waitFor('@oldpasswd-input') ->assertInputValue('@oldpasswd-input', '') ->assertInputValue('@passwd-input', '') ->assertInputValue('@passwd2-input', '') @@ -145,6 +149,7 @@ public function testShortPasswordPreventsPasswordReset(): void $this->browse(function (Browser $browser) use ($password): void { $browser->loginAs($this->users['admin']) ->visit('/profile') + ->waitFor('@oldpasswd-input') ->assertInputValue('@oldpasswd-input', '') ->assertInputValue('@passwd-input', '') ->assertInputValue('@passwd2-input', '') @@ -167,6 +172,7 @@ public function testCanChangePassword(): void $this->browse(function (Browser $browser) use ($password): void { $browser->loginAs($this->users['admin']) ->visit('/profile') + ->waitFor('@oldpasswd-input') ->assertInputValue('@oldpasswd-input', '') ->assertInputValue('@passwd-input', '') ->assertInputValue('@passwd2-input', '') @@ -185,6 +191,7 @@ public function testCanChangePassword(): void $browser->logout() ->loginAs($user) ->visit('/profile') + ->waitFor('@oldpasswd-input') ->assertInputValue('@oldpasswd-input', '') ->assertInputValue('@passwd-input', '') ->assertInputValue('@passwd2-input', '')