Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
"private": true,
"description": "End-to-end tests for Apex Language Server Extension",
"scripts": {
"test": "echo 'E2E tests temporarily disabled' && exit 0",
"test:debug": "echo 'E2E tests temporarily disabled' && exit 0",
"test:visual": "echo 'E2E tests temporarily disabled' && exit 0",
"server": "echo 'E2E server temporarily disabled' && exit 0"
"test": "playwright test",
"test:debug": "DEBUG_MODE=1 playwright test --debug",
"test:visual": "DEBUG_MODE=1 playwright test --ui",
"server": "node test-server.js",
"clean": "echo 'No artifacts to clean in e2e-tests'",
"clean:all": "npm run clean"
},
"devDependencies": {
"@playwright/test": "^1.55.0",
"@types/node": "^20.11.30",
"typescript": "^5.8.2"
},
"dependencies": {
"express": "^5.1.0",
"http-proxy-middleware": "^3.0.5"
}
}
4 changes: 2 additions & 2 deletions e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export default defineConfig({
],

webServer: {
command: 'npm run test:e2e:server',
command: 'node test-server.js',
port: 3000,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
cwd: process.cwd().endsWith('e2e-tests') ? '..' : '.',
cwd: process.cwd().endsWith('e2e-tests') ? '.' : './e2e-tests',
},

timeout: process.env.CI ? 120_000 : 60_000,
Expand Down
21 changes: 12 additions & 9 deletions e2e-tests/test-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function startTestServer() {
try {
const extensionDevelopmentPath = path.resolve(
__dirname,
'../packages/apex-lsp-vscode-extension',
'../packages/apex-lsp-vscode-extension/dist',
);
const workspacePath = process.env.CI
? path.join(
Expand All @@ -31,14 +31,17 @@ async function startTestServer() {
}

// Verify extension is built (check for critical files)
const distPath = path.join(extensionDevelopmentPath, 'dist');
const packageJsonPath = path.join(distPath, 'package.json');
const extensionJsPath = path.join(distPath, 'extension.js');
const extensionWebJsPath = path.join(distPath, 'extension.web.js');
// extensionDevelopmentPath now points to the dist directory
const packageJsonPath = path.join(extensionDevelopmentPath, 'package.json');
const extensionJsPath = path.join(extensionDevelopmentPath, 'extension.js');
const extensionWebJsPath = path.join(
extensionDevelopmentPath,
'extension.web.js',
);

if (!fs.existsSync(distPath)) {
if (!fs.existsSync(extensionDevelopmentPath)) {
throw new Error(
`Extension dist directory not found: ${distPath}. Run 'npm run build' in the extension directory first.`,
`Extension dist directory not found: ${extensionDevelopmentPath}. Run 'npm run build' in the extension directory first.`,
);
}

Expand Down Expand Up @@ -90,9 +93,9 @@ async function startTestServer() {

// Log extension files for debugging
console.log('📋 Extension files:');
const distFiles = fs.readdirSync(distPath);
const distFiles = fs.readdirSync(extensionDevelopmentPath);
distFiles.forEach((file) => {
const filePath = path.join(distPath, file);
const filePath = path.join(extensionDevelopmentPath, file);
const stats = fs.statSync(filePath);
console.log(
` ${file} (${stats.isDirectory() ? 'dir' : stats.size + ' bytes'})`,
Expand Down
Loading