chore: sync additional local changes and e2e artifacts

This commit is contained in:
Your Name
2026-03-23 18:42:57 +08:00
parent 2ef0f17961
commit 8d0f590264
20 changed files with 2512 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ export default defineConfig({
globalSetup: './global-setup.cjs',
use: {
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173',
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5176',
trace: 'off',
screenshot: 'off',
video: 'off',

View File

@@ -64,7 +64,7 @@ test.describe('🦟 蚊子项目 E2E测试 - API可用性验证', () => {
});
test('前端服务可访问', async ({ page }, testInfo) => {
const FRONTEND_URL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173';
const FRONTEND_URL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5176';
await page.goto(FRONTEND_URL);

View File

@@ -12,7 +12,7 @@ import { test, expect } from '@playwright/test';
test.describe('👤 用户H5前端操作测试', () => {
const FRONTEND_URL = process.env.H5_BASE_URL || 'http://localhost:5173';
const FRONTEND_URL = process.env.H5_BASE_URL || 'http://localhost:5176';
const API_BASE_URL = process.env.API_BASE_URL || 'http://localhost:8080';
/**

View File

@@ -9,7 +9,7 @@ test('简单健康检查 - 后端API', async ({ request }) => {
test('简单健康检查 - 前端服务', async ({ page }) => {
// 简单检查前端服务是否可访问
const response = await page.goto('http://localhost:5173');
const response = await page.goto('http://localhost:5176');
expect(response).not.toBeNull();
expect(response?.status()).toBeLessThan(400);
});

View File

@@ -7,7 +7,7 @@ import { test, expect } from '@playwright/test';
test.describe('👤 用户前端操作测试', () => {
const FRONTEND_URL = 'http://localhost:5173';
const FRONTEND_URL = process.env.H5_BASE_URL || 'http://localhost:5176';
const API_BASE_URL = 'http://localhost:8080';
test.beforeEach(async ({ page }) => {

View File

@@ -12,7 +12,7 @@ import { fileURLToPath } from 'url';
*/
const API_BASE_URL = process.env.API_BASE_URL || 'http://localhost:8080';
const FRONTEND_URL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173';
const FRONTEND_URL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5176';
const DEFAULT_TEST_API_KEY = 'test-api-key-000000000000';
const DEFAULT_TEST_USER_TOKEN = 'test-e2e-token';
@@ -38,7 +38,7 @@ function loadTestData(): TestData {
userToken: process.env.E2E_USER_TOKEN || DEFAULT_TEST_USER_TOKEN,
userId: 10001,
shortCode: 'test123',
baseUrl: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173',
baseUrl: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5176',
apiBaseUrl: process.env.API_BASE_URL || 'http://localhost:8080',
};

View File

@@ -12,7 +12,7 @@ import { fileURLToPath } from 'url';
*/
const API_BASE_URL = process.env.API_BASE_URL || 'http://localhost:8080';
const FRONTEND_URL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173';
const FRONTEND_URL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5176';
const DEFAULT_TEST_API_KEY = 'test-api-key-000000000000';
const DEFAULT_TEST_USER_TOKEN = 'test-e2e-token';
@@ -38,7 +38,7 @@ function loadTestData(): TestData {
userToken: process.env.E2E_USER_TOKEN || DEFAULT_TEST_USER_TOKEN,
userId: 10001,
shortCode: 'test123',
baseUrl: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173',
baseUrl: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5176',
apiBaseUrl: process.env.API_BASE_URL || 'http://localhost:8080',
};

View File

@@ -0,0 +1,14 @@
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
baseUrl: 'http://localhost:5173',
supportFile: false,
video: false,
screenshotOnRunFailure: false,
e2e: {
// We've imported your old cypress/plugins/index.js file that was previously here
},
},
});

File diff suppressed because it is too large Load Diff

View File

@@ -15,9 +15,11 @@
"vue-router": "^4.2.5"
},
"devDependencies": {
"@playwright/test": "^1.58.2",
"@types/node": "^20.10.0",
"@vitejs/plugin-vue": "^5.0.0",
"autoprefixer": "^10.4.17",
"cypress": "^15.12.0",
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
"typescript": "~5.3.0",

Binary file not shown.

View File

@@ -40,7 +40,7 @@ module.exports = defineConfig({
...devices['Desktop Chrome'],
launchOptions: {
executablePath: chromiumPath,
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu']
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu', '--headless=new']
}
},
},

View File

@@ -42,11 +42,11 @@ module.exports = defineConfig({
projects: [
{
name: 'chromium',
use: {
use: {
browserName: 'chromium',
launchOptions: {
executablePath: '/home/long/.cache/ms-playwright/chromium-1200/chrome-linux64/chrome',
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu']
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu', '--headless=new']
}
},
},