From a996cde39dbb0b256ebf13c769736cf5d2d2bd86 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 25 Sep 2024 15:16:08 +0100 Subject: [PATCH] Fixed flaky member expertise test no issue - a change in browser version/dependency versions/playwright/something else has made this test flaky because the reply editor form loses focus when the expertise field gains focus (this doesn't happen in the browser) meaning when we get to our assertions the elements we care about are missing - forcing focus back puts us into a known state for our assertions --- apps/comments-ui/test/e2e/actions.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/comments-ui/test/e2e/actions.test.ts b/apps/comments-ui/test/e2e/actions.test.ts index 72c815209b..a9a9e0c4e9 100644 --- a/apps/comments-ui/test/e2e/actions.test.ts +++ b/apps/comments-ui/test/e2e/actions.test.ts @@ -143,6 +143,11 @@ test.describe('Actions', async () => { await expect(profileModal).not.toBeVisible(); + // playwright can lose focus on the editor which hides the member details, + // re-clicking here brings the member details back into view + await editor.click({force: true}); + await waitEditorFocused(editor); + await expect(frame.getByTestId('member-name')).toHaveText('Testy McTest'); await expect(frame.getByTestId('expertise-button')).toHaveText('·Software development'); });