Improves the admin e2e test splitting by grouping them by type with semantic names as opposed to numerically. This will provide much needed clarity to exactly _where_ new admin tests should be written and help to quickly distinguish the areas of failure within the CI overview.
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
import { expect, test } from '@playwright/test'
|
|
import * as path from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
import { ensureCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
|
|
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
|
|
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
|
|
import { TEST_TIMEOUT_LONG } from '../playwright.config.js'
|
|
|
|
const filename = fileURLToPath(import.meta.url)
|
|
const dirname = path.dirname(filename)
|
|
|
|
test.describe('Community', () => {
|
|
let page: Page
|
|
let url: AdminUrlUtil
|
|
|
|
test.beforeAll(async ({ browser }, testInfo) => {
|
|
testInfo.setTimeout(TEST_TIMEOUT_LONG)
|
|
|
|
const { payload, serverURL } = await initPayloadE2ENoConfig({ dirname })
|
|
url = new AdminUrlUtil(serverURL, 'posts')
|
|
|
|
const context = await browser.newContext()
|
|
page = await context.newPage()
|
|
initPageConsoleErrorCatch(page)
|
|
await ensureCompilationIsDone({ page, serverURL })
|
|
})
|
|
|
|
test('example test', async () => {
|
|
await page.goto(url.list)
|
|
|
|
const textCell = page.locator('.row-1 .cell-title')
|
|
await expect(textCell).toHaveText('example post')
|
|
})
|
|
})
|