|
| 1 | +import type { Page } from '@playwright/test' |
| 2 | + |
| 3 | +import { expect, test } from '@playwright/test' |
| 4 | +import * as path from 'path' |
| 5 | +import { fileURLToPath } from 'url' |
| 6 | + |
| 7 | +import { ensureCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js' |
| 8 | +import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' |
| 9 | +import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js' |
| 10 | +import { TEST_TIMEOUT_LONG } from '../playwright.config.js' |
| 11 | + |
| 12 | +const filename = fileURLToPath(import.meta.url) |
| 13 | +const dirname = path.dirname(filename) |
| 14 | + |
| 15 | +test.describe('serverURL', () => { |
| 16 | + let page: Page |
| 17 | + let url: AdminUrlUtil |
| 18 | + |
| 19 | + test.beforeAll(async ({ browser }, testInfo) => { |
| 20 | + testInfo.setTimeout(TEST_TIMEOUT_LONG) |
| 21 | + |
| 22 | + const { payload, serverURL } = await initPayloadE2ENoConfig({ dirname }) |
| 23 | + url = new AdminUrlUtil(serverURL, 'posts') |
| 24 | + |
| 25 | + const context = await browser.newContext() |
| 26 | + page = await context.newPage() |
| 27 | + initPageConsoleErrorCatch(page) |
| 28 | + await ensureCompilationIsDone({ page, serverURL }) |
| 29 | + }) |
| 30 | + |
| 31 | + test('can load admin panel when serverURL is set', async () => { |
| 32 | + await page.goto(url.admin) |
| 33 | + await expect(page.getByText('Dashboard')).toBeVisible() |
| 34 | + }) |
| 35 | +}) |
0 commit comments