chore: sync additional local changes and e2e artifacts
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
@@ -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',
|
||||
};
|
||||
|
||||
|
||||
@@ -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',
|
||||
};
|
||||
|
||||
|
||||
14
frontend/h5/cypress.config.ts
Normal file
14
frontend/h5/cypress.config.ts
Normal 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
|
||||
},
|
||||
},
|
||||
});
|
||||
2034
frontend/h5/package-lock.json
generated
2034
frontend/h5/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
BIN
frontend/h5/xvfb_2%3a21.1.12-1ubuntu1.5_amd64.deb
Normal file
BIN
frontend/h5/xvfb_2%3a21.1.12-1ubuntu1.5_amd64.deb
Normal file
Binary file not shown.
@@ -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']
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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']
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user