@casoon/auditmysite
Version:
Professional website analysis suite with robust accessibility testing, Core Web Vitals performance monitoring, SEO analysis, and content optimization insights. Features isolated browser contexts, retry mechanisms, and comprehensive API endpoints for profe
54 lines (41 loc) โข 1.83 kB
JavaScript
const { HTMLGenerator } = require('./dist/generators/html-generator');
const fs = require('fs');
const path = require('path');
async function testEnhancedGenerator() {
console.log('๐งช Testing Enhanced HTML Generator...');
try {
const generator = new HTMLGenerator();
const jsonPath = path.join(__dirname, 'test-enhanced-reports', 'test-data.json');
console.log('๐ Loading test data from:', jsonPath);
const htmlContent = await generator.generateFromJSON(jsonPath);
const outputPath = path.join(__dirname, 'test-enhanced-reports', 'enhanced-report.html');
fs.writeFileSync(outputPath, htmlContent, 'utf8');
console.log('โ
Enhanced HTML report generated successfully!');
console.log('๐ Report saved to:', outputPath);
// Check if the HTML contains expected elements
if (htmlContent.includes('certificate-badge')) {
console.log('โ
Certificate badge found in HTML');
} else {
console.log('โ Certificate badge NOT found in HTML');
}
if (htmlContent.includes('sticky-nav')) {
console.log('โ
Sticky navigation found in HTML');
} else {
console.log('โ Sticky navigation NOT found in HTML');
}
if (htmlContent.includes('Grade C')) {
console.log('โ
Grade display found in HTML');
} else {
console.log('โ Grade display NOT found in HTML');
}
if (htmlContent.includes('Overall Score: 75/100')) {
console.log('โ
Overall score found in HTML');
} else {
console.log('โ Overall score NOT found in HTML');
}
console.log('๐ Open the HTML file in your browser to see the enhanced report with certificate badges!');
} catch (error) {
console.error('โ Error testing enhanced generator:', error);
}
}
testEnhancedGenerator();