fixes
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
import type { PlaywrightTestConfig } from '@playwright/test'
|
||||
|
||||
import baseConfig from './playwright.config.js'
|
||||
|
||||
const config: PlaywrightTestConfig = {
|
||||
...baseConfig,
|
||||
maxFailures: 1,
|
||||
}
|
||||
|
||||
export default config
|
||||
@@ -1,17 +0,0 @@
|
||||
import { defineConfig } from '@playwright/test'
|
||||
|
||||
export default defineConfig({
|
||||
// Look for test files in the "test" directory, relative to this configuration file
|
||||
testDir: 'test',
|
||||
testMatch: '*e2e.spec.ts',
|
||||
timeout: 180000, // 3 minutes
|
||||
use: {
|
||||
screenshot: 'only-on-failure',
|
||||
trace: 'retain-on-failure',
|
||||
video: 'retain-on-failure',
|
||||
},
|
||||
expect: {
|
||||
timeout: 45000,
|
||||
},
|
||||
workers: 16,
|
||||
})
|
||||
@@ -1,11 +1,14 @@
|
||||
import path from 'path'
|
||||
import { getFileByPath } from 'payload/uploads'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
|
||||
import { devUser } from '../credentials.js'
|
||||
import { MediaCollection } from './collections/Media/index.js'
|
||||
import { PostsCollection, postsSlug } from './collections/Posts/index.js'
|
||||
import { MenuGlobal } from './globals/Menu/index.js'
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
|
||||
export default buildConfigWithDefaults({
|
||||
// ...extend config here
|
||||
@@ -31,7 +34,7 @@ export default buildConfigWithDefaults({
|
||||
})
|
||||
|
||||
// Create image
|
||||
const imageFilePath = path.resolve(process.cwd(), './test/uploads/image.png')
|
||||
const imageFilePath = path.resolve(dirname, '../uploads/image.png')
|
||||
const imageFile = await getFileByPath(imageFilePath)
|
||||
|
||||
await payload.create({
|
||||
|
||||
@@ -69,7 +69,6 @@ function executePlaywright(suitePath: string, bail = false) {
|
||||
console.log(`Executing ${suitePath}...`)
|
||||
const playwrightCfg = path.resolve(
|
||||
dirname,
|
||||
'..',
|
||||
`${bail ? 'playwright.bail.config.ts' : 'playwright.config.ts'}`,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user