chore: setup payload 3 + next 16 foundation with ipal-kit

This commit is contained in:
MichalC
2026-08-31 21:24:53 +02:00
commit 5f2eaa0b37
46 changed files with 11884 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
import { test, expect, Page } from '@playwright/test'
import { login } from '../helpers/login'
import { seedTestUser, cleanupTestUser, testUser } from '../helpers/seedUser'
test.describe('Admin Panel', () => {
let page: Page
test.beforeAll(async ({ browser }, testInfo) => {
await seedTestUser()
const context = await browser.newContext()
page = await context.newPage()
await login({ page, user: testUser })
})
test.afterAll(async () => {
await cleanupTestUser()
})
test('can navigate to dashboard', async () => {
await page.goto('http://localhost:3000/admin')
await expect(page).toHaveURL('http://localhost:3000/admin')
const dashboardArtifact = page.locator('.step-nav__first').first()
await expect(dashboardArtifact).toBeVisible()
})
test('can navigate to list view', async () => {
await page.goto('http://localhost:3000/admin/collections/users')
await expect(page).toHaveURL('http://localhost:3000/admin/collections/users')
const listViewArtifact = page.locator('h1', { hasText: 'Users' }).first()
await expect(listViewArtifact).toBeVisible()
})
test('can navigate to edit view', async () => {
await page.goto('http://localhost:3000/admin/collections/users/create')
await expect(page).toHaveURL(/\/admin\/collections\/users\/[a-zA-Z0-9-_]+/)
const editViewArtifact = page.locator('input[name="email"]')
await expect(editViewArtifact).toBeVisible()
})
})
+20
View File
@@ -0,0 +1,20 @@
import { test, expect, Page } from '@playwright/test'
test.describe('Frontend', () => {
let page: Page
test.beforeAll(async ({ browser }, testInfo) => {
const context = await browser.newContext()
page = await context.newPage()
})
test('can go on homepage', async ({ page }) => {
await page.goto('http://localhost:3000')
await expect(page).toHaveTitle(/Payload Blank Template/)
const heading = page.locator('h1').first()
await expect(heading).toHaveText('Welcome to your new project.')
})
})