mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
- Introduced Timestamp component for displaying formatted dates and relative time. - Added Toggle component for switch-like functionality with customizable sizes. - Implemented TreeIcon component for rendering tree icons using Phosphor icons. - Created EditorActions component for explain and improve actions with icons. - Developed FileTabs component for managing open files with close functionality. - Added LazyInlineMonacoEditor and LazyMonacoEditor for lazy loading Monaco editor. - Implemented NavigationItem for navigation with badges and icons. - Created PageHeaderContent for displaying page headers with icons and descriptions. - Added JSON configuration files for various UI components and layouts. - Enhanced data binding with new computed data source hook. - Updated component registry and types for new components. - Configured Vite for improved hot module replacement experience.
69 lines
2.5 KiB
TypeScript
69 lines
2.5 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
|
|
|
test.describe('CodeForge - Core Functionality', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
test.setTimeout(20000)
|
|
await page.goto('/', { waitUntil: 'domcontentloaded', timeout: 10000 })
|
|
await page.waitForLoadState('networkidle', { timeout: 5000 })
|
|
})
|
|
|
|
test('should load the application successfully', async ({ page }) => {
|
|
// Check root has children (content rendered)
|
|
await page.waitForSelector('#root > *', { timeout: 10000 })
|
|
const root = page.locator('#root')
|
|
await expect(root).toHaveCount(1)
|
|
})
|
|
|
|
test('should display main navigation', async ({ page }) => {
|
|
const tabList = page.locator('[role="tablist"]').first()
|
|
await expect(tabList).toBeVisible({ timeout: 5000 })
|
|
})
|
|
|
|
test('should switch between tabs', async ({ page }) => {
|
|
const tabs = page.locator('button[role="tab"]')
|
|
const tabCount = await tabs.count()
|
|
|
|
if (tabCount > 1) {
|
|
await tabs.nth(1).click()
|
|
await expect(page.locator('[role="tabpanel"]:visible')).toBeVisible({ timeout: 3000 })
|
|
}
|
|
})
|
|
})
|
|
|
|
test.describe('CodeForge - Code Editor', () => {
|
|
test('should display Monaco editor', async ({ page }) => {
|
|
test.setTimeout(30000)
|
|
await page.goto('/', { waitUntil: 'domcontentloaded', timeout: 10000 })
|
|
await page.waitForLoadState('networkidle', { timeout: 5000 })
|
|
|
|
const codeEditorTab = page.locator('button[role="tab"]').filter({ hasText: /Code Editor/i }).first()
|
|
if (await codeEditorTab.isVisible({ timeout: 3000 })) {
|
|
await codeEditorTab.click()
|
|
await page.waitForLoadState('networkidle', { timeout: 10000 })
|
|
|
|
const monacoEditor = page.locator('.monaco-editor').first()
|
|
await expect(monacoEditor).toBeVisible({ timeout: 15000 })
|
|
}
|
|
})
|
|
})
|
|
|
|
test.describe('CodeForge - Responsive Design', () => {
|
|
test('should work on mobile viewport', async ({ page }) => {
|
|
test.setTimeout(20000)
|
|
await page.setViewportSize({ width: 375, height: 667 })
|
|
await page.goto('/', { waitUntil: 'domcontentloaded', timeout: 10000 })
|
|
await page.waitForLoadState('networkidle', { timeout: 5000 })
|
|
|
|
await page.waitForSelector('#root > *', { timeout: 10000 })
|
|
})
|
|
|
|
test('should work on tablet viewport', async ({ page }) => {
|
|
test.setTimeout(20000)
|
|
await page.setViewportSize({ width: 768, height: 1024 })
|
|
await page.goto('/', { waitUntil: 'domcontentloaded', timeout: 10000 })
|
|
await page.waitForLoadState('networkidle', { timeout: 5000 })
|
|
|
|
await page.waitForSelector('#root > *', { timeout: 10000 })
|
|
})
|
|
})
|