This commit is contained in:
Alessio Gravili
2024-03-20 10:52:21 -04:00
parent ee2b6d3b85
commit 68d0a442e4
5 changed files with 5 additions and 30 deletions

View File

@@ -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

View File

@@ -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,
})

View File

@@ -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({

View File

@@ -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'}`,
)

View File

@@ -154,4 +154,4 @@
".next/types/**/*.ts",
"scripts/**/*.ts"
]
}
}