Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b5b6b2

Browse files
committed
feat: add integration and E2E tests
- Add Playwright for E2E testing with 23 test cases covering: - Application layout and navigation - Sidebar tab switching - Chat input interactions - Session management - Settings modal - Responsive layout - Keyboard navigation - Error handling - Add integration tests for new features: - Sidebar component integration (10 tests) - FileExplorer component (16 tests) - GitStatus component (21 tests) - Add npm scripts: test:e2e, test:e2e:ui, test:e2e:headed, test:all
1 parent d911450 commit 9b5b6b2

7 files changed

Lines changed: 2283 additions & 0 deletions

File tree

package-lock.json

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"test:run": "vitest run",
2020
"test:ui": "vitest --ui",
2121
"test:coverage": "vitest run --coverage",
22+
"test:e2e": "playwright test",
23+
"test:e2e:ui": "playwright test --ui",
24+
"test:e2e:headed": "playwright test --headed",
25+
"test:all": "vitest run && playwright test",
2226
"prepare": "husky"
2327
},
2428
"dependencies": {
@@ -38,6 +42,7 @@
3842
},
3943
"devDependencies": {
4044
"@eslint/js": "^9.39.2",
45+
"@playwright/test": "^1.57.0",
4146
"@tailwindcss/postcss": "^4.1.18",
4247
"@tauri-apps/cli": "^2.9.6",
4348
"@types/node": "^24.10.1",
@@ -54,6 +59,7 @@
5459
"happy-dom": "^20.0.11",
5560
"husky": "^9.1.7",
5661
"lint-staged": "^16.2.7",
62+
"playwright": "^1.57.0",
5763
"postcss": "^8.5.6",
5864
"prettier": "^3.7.4",
5965
"tailwindcss": "^4.1.18",

playwright.config.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { defineConfig, devices } from '@playwright/test'
2+
3+
/**
4+
* Playwright E2E test configuration for CodePod
5+
* @see https://playwright.dev/docs/test-configuration
6+
*/
7+
export default defineConfig({
8+
testDir: './tests/e2e',
9+
/* Run tests in files in parallel */
10+
fullyParallel: true,
11+
/* Fail the build on CI if you accidentally left test.only in the source code. */
12+
forbidOnly: !!process.env.CI,
13+
/* Retry on CI only */
14+
retries: process.env.CI ? 2 : 0,
15+
/* Opt out of parallel tests on CI. */
16+
workers: process.env.CI ? 1 : undefined,
17+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
18+
reporter: [['html', { outputFolder: 'playwright-report' }], ['list']],
19+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
20+
use: {
21+
/* Base URL to use in actions like `await page.goto('/')`. */
22+
baseURL: 'http://localhost:5173',
23+
24+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
25+
trace: 'on-first-retry',
26+
27+
/* Take screenshot on failure */
28+
screenshot: 'only-on-failure',
29+
},
30+
31+
/* Configure projects for major browsers */
32+
projects: [
33+
{
34+
name: 'chromium',
35+
use: { ...devices['Desktop Chrome'] },
36+
},
37+
/* Uncomment to test on more browsers
38+
{
39+
name: 'firefox',
40+
use: { ...devices['Desktop Firefox'] },
41+
},
42+
{
43+
name: 'webkit',
44+
use: { ...devices['Desktop Safari'] },
45+
},
46+
*/
47+
],
48+
49+
/* Run your local dev server before starting the tests */
50+
webServer: {
51+
command: 'npm run dev',
52+
url: 'http://localhost:5173',
53+
reuseExistingServer: !process.env.CI,
54+
timeout: 120 * 1000,
55+
},
56+
})

0 commit comments

Comments
 (0)