test(e2e): assert server-rendered biography after profile update (#40176)

Since Playwright 1.56, a WebKit click on a native submit button can
return before the form navigation starts, so `toHaveValue` passed on the
old page with the value `fill()` just set, and the next step raced the
reload.

Assert the textarea's text instead, its server-rendered default, which
only the reloaded page has.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
silverwind
2026-11-09 21:50:27 +00:00
committed by GitHub
parent 06b393e402
commit 3c41728017

View File

@@ -10,11 +10,11 @@ test('update profile biography', async ({page, request}) => {
await page.getByLabel('Biography').fill(bio);
await page.getByRole('button', {name: 'Update Profile'}).click();
await expect(page.getByText('Your profile has been updated.', {exact: true})).toBeVisible();
await expect(page.getByLabel('Biography')).toHaveValue(bio);
await expect(page.getByLabel('Biography')).toHaveText(bio);
await page.getByLabel('Biography').fill('');
await page.getByRole('button', {name: 'Update Profile'}).click();
await expect(page.getByText('Your profile has been updated.', {exact: true})).toBeVisible();
await expect(page.getByLabel('Biography')).toHaveValue('');
await expect(page.getByLabel('Biography')).toHaveText('');
});
test('select and deselect all webhook events', async ({page}) => {