chore: ensure autologin passes before starting tests for all e2e test suites (#5659)

This commit is contained in:
Alessio Gravili
2024-04-04 13:39:06 -04:00
committed by GitHub
parent 3544375fdd
commit e912dde08d
14 changed files with 116 additions and 37 deletions

View File

@@ -4,7 +4,7 @@ import { expect, test } from '@playwright/test'
import * as path from 'path' import * as path from 'path'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import { initPageConsoleErrorCatch } from '../helpers.js' import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
@@ -22,6 +22,7 @@ test.describe('Admin Panel', () => {
const context = await browser.newContext() const context = await browser.newContext()
page = await context.newPage() page = await context.newPage()
initPageConsoleErrorCatch(page) initPageConsoleErrorCatch(page)
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
test('example test', async () => { test('example test', async () => {

View File

@@ -9,6 +9,7 @@ import type { ReadOnlyCollection, RestrictedVersion } from './payload-types.js'
import { import {
closeNav, closeNav,
ensureAutoLoginAndCompilationIsDone,
exactText, exactText,
initPageConsoleErrorCatch, initPageConsoleErrorCatch,
openDocControls, openDocControls,
@@ -59,6 +60,7 @@ describe('access control', () => {
const context = await browser.newContext() const context = await browser.newContext()
page = await context.newPage() page = await context.newPage()
initPageConsoleErrorCatch(page) initPageConsoleErrorCatch(page)
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
test('field without read access should not show', async () => { test('field without read access should not show', async () => {

View File

@@ -11,6 +11,7 @@ import type { Geo, Post } from './payload-types.js'
import { import {
checkBreadcrumb, checkBreadcrumb,
checkPageTitle, checkPageTitle,
ensureAutoLoginAndCompilationIsDone,
exactText, exactText,
initPageConsoleErrorCatch, initPageConsoleErrorCatch,
openDocControls, openDocControls,
@@ -78,6 +79,7 @@ describe('admin', () => {
}) })
beforeEach(async () => { beforeEach(async () => {
await clearAndSeedEverything(payload) await clearAndSeedEverything(payload)
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
describe('Nav', () => { describe('Nav', () => {

View File

@@ -4,7 +4,7 @@ import { expect, test } from '@playwright/test'
import path from 'path' import path from 'path'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import { initPageConsoleErrorCatch } from '../helpers.js' import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
const { beforeAll, describe } = test const { beforeAll, describe } = test
@@ -20,6 +20,8 @@ describe('field error states', () => {
const context = await browser.newContext() const context = await browser.newContext()
page = await context.newPage() page = await context.newPage()
initPageConsoleErrorCatch(page) initPageConsoleErrorCatch(page)
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
test('Remove row should remove error states from parent fields', async () => { test('Remove row should remove error states from parent fields', async () => {

View File

@@ -14,9 +14,16 @@ import type {
RelationWithTitle, RelationWithTitle,
} from './payload-types.js' } from './payload-types.js'
import { initPageConsoleErrorCatch, openDocControls, saveDocAndAssert } from '../helpers.js' import {
delayNetwork,
ensureAutoLoginAndCompilationIsDone,
initPageConsoleErrorCatch,
openDocControls,
saveDocAndAssert,
} from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
import { POLL_TOPASS_TIMEOUT } from '../playwright.config.js'
import { import {
relationFalseFilterOptionSlug, relationFalseFilterOptionSlug,
relationOneSlug, relationOneSlug,
@@ -123,6 +130,8 @@ describe('fields - relationship', () => {
relationshipWithTitle: relationWithTitle.id, relationshipWithTitle: relationWithTitle.id,
}, },
})) as any })) as any
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
test('should create relationship', async () => { test('should create relationship', async () => {

View File

@@ -9,6 +9,7 @@ import { fileURLToPath } from 'url'
import type { RelationshipField, TextField } from './payload-types.js' import type { RelationshipField, TextField } from './payload-types.js'
import { import {
ensureAutoLoginAndCompilationIsDone,
exactText, exactText,
initPageConsoleErrorCatch, initPageConsoleErrorCatch,
saveDocAndAssert, saveDocAndAssert,
@@ -56,6 +57,8 @@ describe('fields', () => {
} }
client = new RESTClient(null, { defaultSlug: 'users', serverURL }) client = new RESTClient(null, { defaultSlug: 'users', serverURL })
await client.login() await client.login()
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
describe('text', () => { describe('text', () => {
let url: AdminUrlUtil let url: AdminUrlUtil

View File

@@ -35,6 +35,30 @@ const networkConditions = {
}, },
} }
/**
* Load admin panel and make sure autologin has passed before running tests
* @param page
* @param serverURL
*/
export async function ensureAutoLoginAndCompilationIsDone({
page,
serverURL,
}: {
page: Page
serverURL: string
}): Promise<void> {
const adminURL = `${serverURL}/admin`
await page.goto(adminURL)
await page.waitForURL(adminURL)
await expect(() => expect(page.url()).not.toContain(`/admin/login`)).toPass({
timeout: POLL_TOPASS_TIMEOUT,
})
await expect(() => expect(page.url()).not.toContain(`/admin/create-first-user`)).toPass({
timeout: POLL_TOPASS_TIMEOUT,
})
}
export async function delayNetwork({ export async function delayNetwork({
context, context,
page, page,

View File

@@ -4,9 +4,15 @@ import { expect, test } from '@playwright/test'
import path from 'path' import path from 'path'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import { exactText, initPageConsoleErrorCatch, saveDocAndAssert } from '../helpers.js' import {
ensureAutoLoginAndCompilationIsDone,
exactText,
initPageConsoleErrorCatch,
saveDocAndAssert,
} from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
import { POLL_TOPASS_TIMEOUT } from '../playwright.config.js'
import { mobileBreakpoint } from './shared.js' import { mobileBreakpoint } from './shared.js'
const filename = fileURLToPath(import.meta.url) const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename) const dirname = path.dirname(filename)
@@ -22,7 +28,7 @@ describe('Live Preview', () => {
await page.goto(url.list) await page.goto(url.list)
const linkToDoc = page.locator('tbody tr:first-child .cell-title a').first() const linkToDoc = page.locator('tbody tr:first-child .cell-title a').first()
await expect(() => expect(linkToDoc).toBeTruthy()).toPass({ timeout: 45000 }) await expect(() => expect(linkToDoc).toBeTruthy()).toPass({ timeout: POLL_TOPASS_TIMEOUT })
const linkDocHref = await linkToDoc.getAttribute('href') const linkDocHref = await linkToDoc.getAttribute('href')
await linkToDoc.click() await linkToDoc.click()
@@ -48,6 +54,8 @@ describe('Live Preview', () => {
page = await context.newPage() page = await context.newPage()
initPageConsoleErrorCatch(page) initPageConsoleErrorCatch(page)
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
test('collection - has tab', async () => { test('collection - has tab', async () => {
@@ -57,13 +65,15 @@ describe('Live Preview', () => {
hasText: exactText('Live Preview'), hasText: exactText('Live Preview'),
}) })
await expect(() => expect(livePreviewTab).toBeTruthy()).toPass({ timeout: 45000 }) await expect(() => expect(livePreviewTab).toBeTruthy()).toPass({ timeout: POLL_TOPASS_TIMEOUT })
const href = await livePreviewTab.locator('a').first().getAttribute('href') const href = await livePreviewTab.locator('a').first().getAttribute('href')
const docURL = page.url() const docURL = page.url()
const pathname = new URL(docURL).pathname const pathname = new URL(docURL).pathname
await expect(() => expect(href).toBe(`${pathname}/preview`)).toPass({ timeout: 45000 }) await expect(() => expect(href).toBe(`${pathname}/preview`)).toPass({
timeout: POLL_TOPASS_TIMEOUT,
})
}) })
test('collection - has route', async () => { test('collection - has route', async () => {
@@ -71,7 +81,9 @@ describe('Live Preview', () => {
const url = page.url() const url = page.url()
await goToCollectionPreview(page) await goToCollectionPreview(page)
await expect(() => expect(page.url()).toBe(`${url}/preview`)).toPass({ timeout: 45000 }) await expect(() => expect(page.url()).toBe(`${url}/preview`)).toPass({
timeout: POLL_TOPASS_TIMEOUT,
})
}) })
test('collection - renders iframe', async () => { test('collection - renders iframe', async () => {
@@ -90,13 +102,13 @@ describe('Live Preview', () => {
// Forces the test to wait for the nextjs route to render before we try editing a field // Forces the test to wait for the nextjs route to render before we try editing a field
await expect(() => expect(frame.locator('#page-title')).toBeVisible()).toPass({ await expect(() => expect(frame.locator('#page-title')).toBeVisible()).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await field.fill(titleValue) await field.fill(titleValue)
await expect(() => expect(frame.locator('#page-title')).toHaveText(titleValue)).toPass({ await expect(() => expect(frame.locator('#page-title')).toHaveText(titleValue)).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await saveDocAndAssert(page) await saveDocAndAssert(page)
@@ -123,17 +135,21 @@ describe('Live Preview', () => {
hasText: exactText('Live Preview'), hasText: exactText('Live Preview'),
}) })
await expect(() => expect(livePreviewTab).toBeTruthy()).toPass({ timeout: 45000 }) await expect(() => expect(livePreviewTab).toBeTruthy()).toPass({ timeout: POLL_TOPASS_TIMEOUT })
const href = await livePreviewTab.locator('a').first().getAttribute('href') const href = await livePreviewTab.locator('a').first().getAttribute('href')
await expect(() => expect(href).toBe(`${pathname}/preview`)).toPass({ timeout: 45000 }) await expect(() => expect(href).toBe(`${pathname}/preview`)).toPass({
timeout: POLL_TOPASS_TIMEOUT,
})
}) })
test('global - has route', async () => { test('global - has route', async () => {
const url = page.url() const url = page.url()
await goToGlobalPreview(page, 'header') await goToGlobalPreview(page, 'header')
await expect(() => expect(page.url()).toBe(`${url}/preview`)).toPass({ timeout: 45000 }) await expect(() => expect(page.url()).toBe(`${url}/preview`)).toPass({
timeout: POLL_TOPASS_TIMEOUT,
})
}) })
test('global - renders iframe', async () => { test('global - renders iframe', async () => {
@@ -160,7 +176,9 @@ describe('Live Preview', () => {
await goToCollectionPreview(page) await goToCollectionPreview(page)
await expect(() => expect(page.url()).toContain('/preview')).toPass({ timeout: 45000 }) await expect(() => expect(page.url()).toContain('/preview')).toPass({
timeout: POLL_TOPASS_TIMEOUT,
})
const iframe = page.locator('iframe') const iframe = page.locator('iframe')
@@ -172,10 +190,10 @@ describe('Live Preview', () => {
const widthInput = page.locator('.live-preview-toolbar input[name="live-preview-width"]') const widthInput = page.locator('.live-preview-toolbar input[name="live-preview-width"]')
await expect(() => expect(widthInput).toBeTruthy()).toPass({ timeout: 45000 }) await expect(() => expect(widthInput).toBeTruthy()).toPass({ timeout: POLL_TOPASS_TIMEOUT })
const heightInput = page.locator('.live-preview-toolbar input[name="live-preview-height"]') const heightInput = page.locator('.live-preview-toolbar input[name="live-preview-height"]')
await expect(() => expect(heightInput).toBeTruthy()).toPass({ timeout: 45000 }) await expect(() => expect(heightInput).toBeTruthy()).toPass({ timeout: POLL_TOPASS_TIMEOUT })
const widthInputValue = await widthInput.getAttribute('value') const widthInputValue = await widthInput.getAttribute('value')
const width = parseInt(widthInputValue) const width = parseInt(widthInputValue)
@@ -186,19 +204,19 @@ describe('Live Preview', () => {
const tolerance = 2 const tolerance = 2
await expect(() => expect(iframeWidthInPx).toBeLessThanOrEqual(width + tolerance)).toPass({ await expect(() => expect(iframeWidthInPx).toBeLessThanOrEqual(width + tolerance)).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await expect(() => expect(iframeWidthInPx).toBeGreaterThanOrEqual(width - tolerance)).toPass({ await expect(() => expect(iframeWidthInPx).toBeGreaterThanOrEqual(width - tolerance)).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await expect(() => expect(iframeHeightInPx).toBeLessThanOrEqual(height + tolerance)).toPass({ await expect(() => expect(iframeHeightInPx).toBeLessThanOrEqual(height + tolerance)).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await expect(() => expect(iframeHeightInPx).toBeGreaterThanOrEqual(height - tolerance)).toPass({ await expect(() => expect(iframeHeightInPx).toBeGreaterThanOrEqual(height - tolerance)).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
}) })
@@ -211,7 +229,7 @@ describe('Live Preview', () => {
await goToCollectionPreview(page) await goToCollectionPreview(page)
await expect(() => expect(page.url()).toContain('/preview')).toPass({ await expect(() => expect(page.url()).toContain('/preview')).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
// Check that the breakpoint select is present // Check that the breakpoint select is present
@@ -220,7 +238,7 @@ describe('Live Preview', () => {
) )
await expect(() => expect(breakpointSelector).toBeTruthy()).toPass({ await expect(() => expect(breakpointSelector).toBeTruthy()).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
// Select the mobile breakpoint // Select the mobile breakpoint
@@ -241,7 +259,7 @@ describe('Live Preview', () => {
const iframe = page.locator('iframe') const iframe = page.locator('iframe')
await expect(() => expect(iframe).toBeTruthy()).toPass({ await expect(() => expect(iframe).toBeTruthy()).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
const iframeSize = await iframe.boundingBox() const iframeSize = await iframe.boundingBox()
const iframeWidthInPx = iframeSize?.width const iframeWidthInPx = iframeSize?.width
@@ -251,49 +269,49 @@ describe('Live Preview', () => {
await expect(() => await expect(() =>
expect(iframeWidthInPx).toBeLessThanOrEqual(mobileBreakpoint.width + tolerance), expect(iframeWidthInPx).toBeLessThanOrEqual(mobileBreakpoint.width + tolerance),
).toPass({ ).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await expect(() => await expect(() =>
expect(iframeWidthInPx).toBeGreaterThanOrEqual(mobileBreakpoint.width - tolerance), expect(iframeWidthInPx).toBeGreaterThanOrEqual(mobileBreakpoint.width - tolerance),
).toPass({ ).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await expect(() => await expect(() =>
expect(iframeHeightInPx).toBeLessThanOrEqual(mobileBreakpoint.height + tolerance), expect(iframeHeightInPx).toBeLessThanOrEqual(mobileBreakpoint.height + tolerance),
).toPass({ ).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await expect(() => await expect(() =>
expect(iframeHeightInPx).toBeGreaterThanOrEqual(mobileBreakpoint.height - tolerance), expect(iframeHeightInPx).toBeGreaterThanOrEqual(mobileBreakpoint.height - tolerance),
).toPass({ ).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
// Check that the inputs have been updated to reflect the new size // Check that the inputs have been updated to reflect the new size
const widthInput = page.locator('.live-preview-toolbar input[name="live-preview-width"]') const widthInput = page.locator('.live-preview-toolbar input[name="live-preview-width"]')
await expect(() => expect(widthInput).toBeTruthy()).toPass({ await expect(() => expect(widthInput).toBeTruthy()).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
const heightInput = page.locator('.live-preview-toolbar input[name="live-preview-height"]') const heightInput = page.locator('.live-preview-toolbar input[name="live-preview-height"]')
await expect(() => expect(heightInput).toBeTruthy()).toPass({ await expect(() => expect(heightInput).toBeTruthy()).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
const widthInputValue = await widthInput.getAttribute('value') const widthInputValue = await widthInput.getAttribute('value')
const width = parseInt(widthInputValue) const width = parseInt(widthInputValue)
await expect(() => expect(width).toBe(mobileBreakpoint.width)).toPass({ await expect(() => expect(width).toBe(mobileBreakpoint.width)).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
const heightInputValue = await heightInput.getAttribute('value') const heightInputValue = await heightInput.getAttribute('value')
const height = parseInt(heightInputValue) const height = parseInt(heightInputValue)
await expect(() => expect(height).toBe(mobileBreakpoint.height)).toPass({ await expect(() => expect(height).toBe(mobileBreakpoint.height)).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
}) })
}) })

View File

@@ -10,6 +10,7 @@ import type { Config, LocalizedPost } from './payload-types.js'
import { import {
changeLocale, changeLocale,
ensureAutoLoginAndCompilationIsDone,
initPageConsoleErrorCatch, initPageConsoleErrorCatch,
openDocControls, openDocControls,
saveDocAndAssert, saveDocAndAssert,
@@ -60,6 +61,8 @@ describe('Localization', () => {
page = await context.newPage() page = await context.newPage()
initPageConsoleErrorCatch(page) initPageConsoleErrorCatch(page)
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
describe('localized text', () => { describe('localized text', () => {

View File

@@ -7,7 +7,7 @@ import { fileURLToPath } from 'url'
import type { PayloadTestSDK } from '../helpers/sdk/index.js' import type { PayloadTestSDK } from '../helpers/sdk/index.js'
import type { Config } from './payload-types.js' import type { Config } from './payload-types.js'
import { initPageConsoleErrorCatch } from '../helpers.js' import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
import { POLL_TOPASS_TIMEOUT } from '../playwright.config.js' import { POLL_TOPASS_TIMEOUT } from '../playwright.config.js'
@@ -33,6 +33,8 @@ test.describe('Form Builder', () => {
const context = await browser.newContext() const context = await browser.newContext()
page = await context.newPage() page = await context.newPage()
initPageConsoleErrorCatch(page) initPageConsoleErrorCatch(page)
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
test.describe('Forms collection', () => { test.describe('Forms collection', () => {

View File

@@ -6,7 +6,7 @@ import { fileURLToPath } from 'url'
import type { Page as PayloadPage } from './payload-types.js' import type { Page as PayloadPage } from './payload-types.js'
import { initPageConsoleErrorCatch } from '../helpers.js' import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
@@ -67,6 +67,8 @@ describe('Nested Docs Plugin', () => {
_status: 'draft', _status: 'draft',
}) })
draftChildId = draftChildPage.id draftChildId = draftChildPage.id
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
describe('Core functionality', () => { describe('Core functionality', () => {

View File

@@ -7,7 +7,7 @@ import { fileURLToPath } from 'url'
import type { Page as PayloadPage } from './payload-types.js' import type { Page as PayloadPage } from './payload-types.js'
import { initPageConsoleErrorCatch } from '../helpers.js' import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
import { mediaSlug } from './shared.js' import { mediaSlug } from './shared.js'
@@ -53,6 +53,8 @@ describe('SEO Plugin', () => {
}, },
})) as unknown as PayloadPage })) as unknown as PayloadPage
id = createdPage.id id = createdPage.id
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
describe('Core functionality', () => { describe('Core functionality', () => {

View File

@@ -8,7 +8,11 @@ import { fileURLToPath } from 'url'
import type { Media } from './payload-types.js' import type { Media } from './payload-types.js'
import { initPageConsoleErrorCatch, saveDocAndAssert } from '../helpers.js' import {
ensureAutoLoginAndCompilationIsDone,
initPageConsoleErrorCatch,
saveDocAndAssert,
} from '../helpers.js'
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
import { initPayloadE2E } from '../helpers/initPayloadE2E.js' import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
import { RESTClient } from '../helpers/rest.js' import { RESTClient } from '../helpers/rest.js'
@@ -74,6 +78,8 @@ describe('uploads', () => {
}) })
audioDoc = findAudio.docs[0] as unknown as Media audioDoc = findAudio.docs[0] as unknown as Media
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
}) })
test('should see upload filename in relation list', async () => { test('should see upload filename in relation list', async () => {

View File

@@ -35,6 +35,7 @@ import type { Config } from './payload-types.js'
import { globalSlug } from '../admin/slugs.js' import { globalSlug } from '../admin/slugs.js'
import { import {
changeLocale, changeLocale,
ensureAutoLoginAndCompilationIsDone,
exactText, exactText,
findTableCell, findTableCell,
initPageConsoleErrorCatch, initPageConsoleErrorCatch,
@@ -70,7 +71,7 @@ const waitForAutoSaveToComplete = async (page: Page) => {
page.locator('.autosave:has-text("Last saved less than a minute ago")'), page.locator('.autosave:has-text("Last saved less than a minute ago")'),
).toBeVisible() ).toBeVisible()
}).toPass({ }).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
} }
@@ -78,7 +79,7 @@ const waitForAutoSaveToRunAndComplete = async (page: Page) => {
await expect(async () => { await expect(async () => {
await expect(page.locator('.autosave:has-text("Saving...")')).toBeVisible() await expect(page.locator('.autosave:has-text("Saving...")')).toBeVisible()
}).toPass({ }).toPass({
timeout: 45000, timeout: POLL_TOPASS_TIMEOUT,
}) })
await waitForAutoSaveToComplete(page) await waitForAutoSaveToComplete(page)
@@ -107,6 +108,8 @@ describe('versions', () => {
serverURL, serverURL,
snapshotKey: 'versionsTest', snapshotKey: 'versionsTest',
}) })
await ensureAutoLoginAndCompilationIsDone({ page, serverURL })
//await clearAndSeedEverything(payload) //await clearAndSeedEverything(payload)
}) })