Fixed browser tests for unsaved changes (#20717)

no issue

- takes into account that there is an additional editor in the DOM -
which there is now.
This commit is contained in:
Ronald Langeveld 2024-08-05 21:40:18 +07:00 committed by GitHub
parent c8ba9e8027
commit 61bf3ea57e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -78,7 +78,7 @@ const createPage = async (page, {title = 'Hello world', body = 'This is my post
await page.locator('[data-test-editor-title-input]').fill(title);
// wait for editor to be ready
await expect(page.locator('[data-lexical-editor="true"]')).toBeVisible();
await expect(page.locator('[data-lexical-editor="true"]').first()).toBeVisible();
// Continue to the body by pressing enter
await page.keyboard.press('Enter');
@ -304,7 +304,7 @@ test.describe('Publishing', () => {
await expect(publishedHeader).toContainText(date.toFormat('LLL d, yyyy'));
// add some extra text to the post
await adminPage.locator('[data-kg="editor"]').click();
await adminPage.locator('[data-kg="editor"]').first().click();
await adminPage.waitForTimeout(200); //
await adminPage.keyboard.type(' This is some updated text.');

View File

@ -423,7 +423,7 @@ const createPostDraft = async (page, {title = 'Hello world', body = 'This is my
await page.locator('[data-test-editor-title-input]').fill(title);
// wait for editor to be ready
await expect(page.locator('[data-lexical-editor="true"]')).toBeVisible();
await expect(page.locator('[data-lexical-editor="true"]').first()).toBeVisible();
// Continue to the body by pressing enter
await page.keyboard.press('Enter');