test-enhanced-spa.jsโข1.76 kB
#!/usr/bin/env node
/**
* TASK-001: Test Enhanced SPA Loading
* Verifies the improved browser automation works with EuConquisto Composer
*/
import { ComposerClient } from './dist/lib/composition-lifecycle.js';
async function testEnhancedSPALoading() {
console.log('๐งช TASK-001: Testing Enhanced SPA Loading...\n');
const client = new ComposerClient();
try {
// Test 1: Initialize browser with enhanced settings
console.log('1๏ธโฃ Testing enhanced browser initialization...');
await client.initialize();
console.log('โ
Enhanced browser initialized successfully\n');
// Test 2: Navigate with progressive SPA loading
console.log('2๏ธโฃ Testing enhanced navigation with SPA handling...');
await client.navigateToComposer();
console.log('โ
Enhanced navigation completed\n');
// Test 3: Try to find DOM elements that should now be available
console.log('3๏ธโฃ Testing DOM element detection after SPA loading...');
const result = await client.createNewComposition();
console.log('๐ Enhanced SPA Test Results:');
console.log(` Success: ${result.success}`);
console.log(` Message: ${result.message}`);
if (result.compositionId) {
console.log(` Composition ID: ${result.compositionId}`);
}
if (result.success) {
console.log('\n๐ TASK-001 SUCCESS: Enhanced SPA loading resolved DOM selector issues!');
} else {
console.log('\nโ ๏ธ TASK-001 PARTIAL: Enhanced SPA loading improved but needs more work');
}
} catch (error) {
console.error('โ TASK-001 FAILED: Enhanced SPA loading test failed:', error.message);
} finally {
await client.close();
}
}
testEnhancedSPALoading().catch(console.error);