From 8b5ff23996e8d2caae50676a23b383b4a0e795e2 Mon Sep 17 00:00:00 2001 From: Nirmal Kumar R Date: Thu, 14 Nov 2024 14:22:16 +0530 Subject: [PATCH] Move the e2e test to markdown-editor.test.e2e.ts --- tests/e2e/actions.test.e2e.ts | 22 ---------------------- tests/e2e/markdown-editor.test.e2e.ts | 24 +++++++++++++++++++++++- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/e2e/actions.test.e2e.ts b/tests/e2e/actions.test.e2e.ts index 2154a71b05..e9f7db52f2 100644 --- a/tests/e2e/actions.test.e2e.ts +++ b/tests/e2e/actions.test.e2e.ts @@ -16,28 +16,6 @@ test.beforeAll(async ({browser}, workerInfo) => { await login_user(browser, workerInfo, 'user2'); }); -test('Markdown image preview behaviour', async ({browser}, workerInfo) => { - const page = await login({browser}, workerInfo); - - const editPath = '/user2/repo1/src/branch/master/README.md'; - - const response = await page.goto(editPath); - expect(response?.status()).toBe(200); - - await page.locator('[data-tooltip-content="Edit file"]').click(); - await page.waitForLoadState('networkidle'); - - const editor = page.locator('[aria-roledescription="editor"]').first(); - await editor.fill(''); - await editor.fill('![Logo of Forgejo](./assets/logo.svg "Logo of Forgejo")'); - - await page.locator('a[data-tab="preview"]').click(); - await page.waitForLoadState('networkidle'); - - const preview = page.locator('div[data-tab="preview"] p[dir="auto"] a'); - await expect(preview).toHaveAttribute('href', 'http://localhost:3003/user2/repo1/media/branch/master/assets/logo.svg'); -}); - const workflow_trigger_notification_text = 'This workflow has a workflow_dispatch event trigger.'; test('workflow dispatch present', async ({browser}, workerInfo) => { diff --git a/tests/e2e/markdown-editor.test.e2e.ts b/tests/e2e/markdown-editor.test.e2e.ts index 4cdf4644f7..766a4d18fb 100644 --- a/tests/e2e/markdown-editor.test.e2e.ts +++ b/tests/e2e/markdown-editor.test.e2e.ts @@ -5,12 +5,34 @@ // @watch end import {expect} from '@playwright/test'; -import {test, load_logged_in_context, login_user} from './utils_e2e.ts'; +import {test, load_logged_in_context, login, login_user} from './utils_e2e.ts'; test.beforeAll(async ({browser}, workerInfo) => { await login_user(browser, workerInfo, 'user2'); }); +test('Markdown image preview behaviour', async ({browser}, workerInfo) => { + const page = await login({browser}, workerInfo); + + const editPath = '/user2/repo1/src/branch/master/README.md'; + + const response = await page.goto(editPath); + expect(response?.status()).toBe(200); + + await page.locator('[data-tooltip-content="Edit file"]').click(); + await page.waitForLoadState('networkidle'); + + const editor = page.locator('[aria-roledescription="editor"]').first(); + await editor.fill(''); + await editor.fill('![Logo of Forgejo](./assets/logo.svg "Logo of Forgejo")'); + + await page.locator('a[data-tab="preview"]').click(); + await page.waitForLoadState('networkidle'); + + const preview = page.locator('div[data-tab="preview"] p[dir="auto"] a'); + await expect(preview).toHaveAttribute('href', 'http://localhost:3003/user2/repo1/media/branch/master/assets/logo.svg'); +}); + test('markdown indentation', async ({browser}, workerInfo) => { const context = await load_logged_in_context(browser, workerInfo, 'user2');