37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const HISTORY_FILE = path.join(__dirname, 'test-history.json');
|
|
|
|
const testFiles = [
|
|
'smoke/navigation.smoke.spec.ts',
|
|
'admin/news-management.spec.ts',
|
|
'api/admin.api.spec.ts',
|
|
];
|
|
|
|
console.log('📊 Testing test scheduler...');
|
|
console.log('Test files:', testFiles);
|
|
|
|
if (fs.existsSync(HISTORY_FILE)) {
|
|
const data = fs.readFileSync(HISTORY_FILE, 'utf-8');
|
|
const history = JSON.parse(data);
|
|
console.log('✅ History loaded');
|
|
console.log('Records:', history.records.length);
|
|
|
|
const schedule = testFiles.map(file => ({
|
|
file,
|
|
testId: file.replace(/[^a-zA-Z0-9]/g, '-'),
|
|
priority: file.includes('smoke') ? 1 : file.includes('api') ? 2 : 3,
|
|
estimatedDuration: 60000,
|
|
dependencies: [],
|
|
}));
|
|
|
|
console.log('\n📋 Scheduled tests:');
|
|
schedule.forEach((test, index) => {
|
|
console.log(` ${index + 1}. ${test.file} (Priority: ${test.priority})`);
|
|
});
|
|
|
|
console.log('\n✅ Scheduler test completed');
|
|
} else {
|
|
console.log('❌ History file not found');
|
|
} |