chore: merge playwright revisions
This commit is contained in:
10
package.json
10
package.json
@@ -72,7 +72,7 @@
|
||||
"@next/bundle-analyzer": "^14.1.0",
|
||||
"@octokit/core": "^5.1.0",
|
||||
"@payloadcms/eslint-config": "workspace:*",
|
||||
"@playwright/test": "1.42.1",
|
||||
"@playwright/test": "^1.42.1",
|
||||
"@swc/cli": "^0.1.62",
|
||||
"@swc/jest": "0.2.36",
|
||||
"@testing-library/jest-dom": "6.4.2",
|
||||
@@ -124,8 +124,8 @@
|
||||
"nodemon": "3.0.3",
|
||||
"pino": "8.15.0",
|
||||
"pino-pretty": "10.2.0",
|
||||
"playwright": "file:playwright-1.43.0-next.tgz",
|
||||
"playwright-core": "file:playwright-core-1.43.0-next.tgz",
|
||||
"playwright": "^1.42.1",
|
||||
"playwright-core": "^1.42.1",
|
||||
"prettier": "^3.0.3",
|
||||
"prompts": "2.4.2",
|
||||
"qs": "6.11.2",
|
||||
@@ -173,9 +173,7 @@
|
||||
"graphql": "^16.8.1",
|
||||
"react": "$react",
|
||||
"react-dom": "$react-dom",
|
||||
"typescript": "$typescript",
|
||||
"playwright": "file:playwright-1.43.0-next.tgz",
|
||||
"playwright-core": "file:playwright-core-1.43.0-next.tgz"
|
||||
"typescript": "$typescript"
|
||||
},
|
||||
"allowedDeprecatedVersions": {
|
||||
"uuid": "3.4.0",
|
||||
|
||||
@@ -47,7 +47,8 @@ export const getPayload = async (options: InitOptions): Promise<Payload> => {
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
try {
|
||||
const ws = new WebSocket('ws://localhost:3000/_next/webpack-hmr')
|
||||
const port = process.env.PORT || '3000'
|
||||
const ws = new WebSocket(`ws://localhost:${port}/_next/webpack-hmr`)
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
if (typeof event.data === 'string') {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
57
pnpm-lock.yaml
generated
57
pnpm-lock.yaml
generated
@@ -13,8 +13,6 @@ overrides:
|
||||
react: ^18.2.0
|
||||
react-dom: ^18.2.0
|
||||
typescript: 5.2.2
|
||||
playwright: file:playwright-1.43.0-next.tgz
|
||||
playwright-core: file:playwright-core-1.43.0-next.tgz
|
||||
|
||||
importers:
|
||||
|
||||
@@ -43,7 +41,7 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:packages/eslint-config-payload
|
||||
'@playwright/test':
|
||||
specifier: 1.42.1
|
||||
specifier: ^1.42.1
|
||||
version: 1.42.1
|
||||
'@swc/cli':
|
||||
specifier: ^0.1.62
|
||||
@@ -192,9 +190,6 @@ importers:
|
||||
nodemon:
|
||||
specifier: 3.0.3
|
||||
version: 3.0.3
|
||||
path-browserify:
|
||||
specifier: ^1.0.1
|
||||
version: 1.0.1
|
||||
pino:
|
||||
specifier: 8.15.0
|
||||
version: 8.15.0
|
||||
@@ -202,11 +197,11 @@ importers:
|
||||
specifier: 10.2.0
|
||||
version: 10.2.0
|
||||
playwright:
|
||||
specifier: file:C:\code\payload\playwright-1.43.0-next.tgz
|
||||
version: file:playwright-1.43.0-next.tgz
|
||||
specifier: ^1.42.1
|
||||
version: 1.42.1
|
||||
playwright-core:
|
||||
specifier: file:C:\code\payload\playwright-core-1.43.0-next.tgz
|
||||
version: file:playwright-core-1.43.0-next.tgz
|
||||
specifier: ^1.42.1
|
||||
version: 1.42.1
|
||||
prettier:
|
||||
specifier: ^3.0.3
|
||||
version: 3.2.5
|
||||
@@ -5182,7 +5177,7 @@ packages:
|
||||
engines: {node: '>=16'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
playwright: file:playwright-1.43.0-next.tgz
|
||||
playwright: 1.42.1
|
||||
dev: true
|
||||
|
||||
/@pnpm/config.env-replace@1.1.0:
|
||||
@@ -14200,10 +14195,6 @@ packages:
|
||||
resolution: {integrity: sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==}
|
||||
engines: {node: '>= 0.4.0'}
|
||||
|
||||
/path-browserify@1.0.1:
|
||||
resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==}
|
||||
dev: true
|
||||
|
||||
/path-exists@3.0.0:
|
||||
resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -14445,6 +14436,22 @@ packages:
|
||||
find-up: 3.0.0
|
||||
dev: false
|
||||
|
||||
/playwright-core@1.42.1:
|
||||
resolution: {integrity: sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==}
|
||||
engines: {node: '>=16'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/playwright@1.42.1:
|
||||
resolution: {integrity: sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==}
|
||||
engines: {node: '>=16'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
playwright-core: 1.42.1
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
dev: true
|
||||
|
||||
/pluralize@8.0.0:
|
||||
resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -18166,26 +18173,6 @@ packages:
|
||||
resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==}
|
||||
dev: false
|
||||
|
||||
file:playwright-1.43.0-next.tgz:
|
||||
resolution: {integrity: sha512-vw1WPxm0BJVOuQeqObJeqRZPkRMEZwBAjdB6H7UB2ZN3mhd/SwnqpmYOU58M3tymjByoNCCU8/1FJucIUG3vLw==, tarball: file:playwright-1.43.0-next.tgz}
|
||||
name: playwright
|
||||
version: 1.43.0-next
|
||||
engines: {node: '>=16'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
playwright-core: file:playwright-core-1.43.0-next.tgz
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
dev: true
|
||||
|
||||
file:playwright-core-1.43.0-next.tgz:
|
||||
resolution: {integrity: sha512-1l2lYqjxj/TdjjKipJU48O3I64KpVDkbrrDB6ChhWE9FdeLv49iqLPgNQoD0Vde3N1etu/50GWkTtPIQUyZTMw==, tarball: file:playwright-core-1.43.0-next.tgz}
|
||||
name: playwright-core
|
||||
version: 1.43.0-next
|
||||
engines: {node: '>=16'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
github.com/Raynos/readable-stream/b1a911ce6e4f4c5a7e2948cd23c2f9ee1ea0696f:
|
||||
resolution: {tarball: https://codeload.github.com/Raynos/readable-stream/tar.gz/b1a911ce6e4f4c5a7e2948cd23c2f9ee1ea0696f}
|
||||
name: readable-stream
|
||||
|
||||
@@ -7,7 +7,6 @@ import { fileURLToPath } from 'url'
|
||||
import { initPageConsoleErrorCatch } from '../helpers.js'
|
||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
|
||||
import { initPayloadE2E } from '../helpers/configHelpers.js'
|
||||
import config from './config.js'
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
@@ -19,7 +18,7 @@ describe('Admin Panel', () => {
|
||||
let url: AdminUrlUtil
|
||||
|
||||
beforeAll(async ({ browser }) => {
|
||||
const { serverURL } = await initPayloadE2E({ config, dirname })
|
||||
const { serverURL } = await initPayloadE2E({ dirname })
|
||||
url = new AdminUrlUtil(serverURL, 'posts')
|
||||
|
||||
const context = await browser.newContext()
|
||||
|
||||
@@ -1,37 +1,60 @@
|
||||
import { spawn } from 'child_process'
|
||||
import getPort from 'get-port'
|
||||
//import { nextDev } from 'next/dist/cli/next-dev.js'
|
||||
import { nextDev } from 'next/dist/cli/next-dev.js'
|
||||
import path from 'path'
|
||||
|
||||
import type { SanitizedConfig } from '../../packages/payload/src/config/types.js'
|
||||
import type { Payload } from '../../packages/payload/src/index.js'
|
||||
import wait from '../../packages/payload/src/utilities/wait.js'
|
||||
|
||||
import { getPayload } from '../../packages/payload/src/index.js'
|
||||
import { bootAdminPanel } from './bootAdminPanel.mjs'
|
||||
|
||||
type InitializedPayload = { payload: Payload; serverURL: string }
|
||||
|
||||
export async function initPayloadE2E(args: {
|
||||
config: Promise<SanitizedConfig>
|
||||
type Args = {
|
||||
dirname: string
|
||||
}): Promise<InitializedPayload> {
|
||||
const { config, dirname } = args
|
||||
}
|
||||
|
||||
console.log('dirname', dirname)
|
||||
type Result = {
|
||||
serverURL: string
|
||||
}
|
||||
|
||||
// process.env.TURBOPACK = '1' // Not working due to turbopack pulling in mongoose, pg
|
||||
export async function initPayloadE2E({ dirname }: Args): Promise<Result> {
|
||||
const port = await getPort()
|
||||
const serverURL = `http://localhost:${port}`
|
||||
process.env.PAYLOAD_CONFIG_PATH = path.resolve(dirname, './config.js')
|
||||
process.env.PAYLOAD_DROP_DATABASE = 'true'
|
||||
//process.env.NODE_ENV = 'test'
|
||||
process.env.PORT = String(port)
|
||||
|
||||
const payload = await getPayload({ config })
|
||||
// @ts-expect-error
|
||||
process.env.NODE_ENV = 'test'
|
||||
|
||||
nextDev({
|
||||
_: [path.resolve(dirname, '../../')],
|
||||
'--port': port,
|
||||
// Turbo doesn't seem to be reading
|
||||
// our tsconfig paths, commented out for now
|
||||
// '--turbo': '1',
|
||||
})
|
||||
|
||||
await wait(3000)
|
||||
return { serverURL }
|
||||
}
|
||||
|
||||
export async function initPayloadSpawn({ dirname }: Args): Promise<Result> {
|
||||
const port = await getPort()
|
||||
const serverURL = `http://localhost:${port}`
|
||||
|
||||
//process.env.APP_ENV = 'test'
|
||||
//process.env.__NEXT_TEST_MODE = 'jest'
|
||||
// Tried using a child process to get
|
||||
// turbopack to pick up our tsconfig aliases
|
||||
// but this didn't make a difference.
|
||||
// Keeping it here so we can continue to try.
|
||||
spawn('pnpm', ['dev', '--turbo'], {
|
||||
cwd: path.resolve(dirname, '../../'),
|
||||
env: {
|
||||
...process.env,
|
||||
NODE_ENV: 'test',
|
||||
PORT: String(port),
|
||||
PAYLOAD_CONFIG_PATH: path.resolve(dirname, '../../config.js'),
|
||||
PAYLOAD_DROP_DATABASE: 'true',
|
||||
},
|
||||
})
|
||||
|
||||
//await nextDev({ _: [path.resolve(dirname, '../../')], port }) // Running nextDev directly does not work for ports other than 3000
|
||||
await bootAdminPanel({ port, appDir: path.resolve(dirname, '../../') })
|
||||
return { serverURL, payload }
|
||||
await wait(3000)
|
||||
|
||||
return { serverURL }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user