From f7d217b6957ace6413a65c7f77fa3d732c3bbe8e Mon Sep 17 00:00:00 2001 From: Nirmal Kumar R Date: Tue, 19 Nov 2024 17:15:34 +0530 Subject: [PATCH] Fix the e2e test for Monaco editor --- tests/e2e/markdown-editor.test.e2e.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/e2e/markdown-editor.test.e2e.ts b/tests/e2e/markdown-editor.test.e2e.ts index bd62e2ba3e..c9d2cbfe49 100644 --- a/tests/e2e/markdown-editor.test.e2e.ts +++ b/tests/e2e/markdown-editor.test.e2e.ts @@ -16,14 +16,15 @@ test('Markdown image preview behaviour', async ({browser}, workerInfo) => { const editPath = '/user2/repo1/src/branch/master/README.md'; - const response = await page.goto(editPath); + const response = await page.goto(editPath, { waitUntil: 'domcontentloaded' }); expect(response?.status()).toBe(200); await page.locator('[data-tooltip-content="Edit file"]').click(); - const editor = page.locator('[aria-roledescription="editor"]').first(); - await editor.fill(''); - await editor.fill('![Logo of Forgejo](./assets/logo.svg "Logo of Forgejo")'); + const editor = page.getByRole("presentation").nth(0); + await editor.click(); + await page.keyboard.press("ControlOrMeta+KeyA"); + await page.keyboard.type('![Logo of Forgejo](./assets/logo.svg "Logo of Forgejo")'); await page.locator('a[data-tab="preview"]').click();