-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-website.js
More file actions
156 lines (127 loc) Β· 6.16 KB
/
Copy pathtest-website.js
File metadata and controls
156 lines (127 loc) Β· 6.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
const fs = require('fs');
const path = require('path');
console.log('π Testing Batteries Plus NSW Website Updates\n');
console.log('=' .repeat(50));
// Test files
const files = ['index.html', 'about.html', 'contact.html', 'services.html'];
const testsPerFile = [];
files.forEach(file => {
const filePath = path.join(__dirname, file);
if (!fs.existsSync(filePath)) {
console.log(`β ${file} not found`);
return;
}
const content = fs.readFileSync(filePath, 'utf8');
const tests = {
file: file,
passed: [],
failed: []
};
// Test 1: Logo image
if (content.includes('photos/batteries_plus_logo_website.jpg')) {
tests.passed.push('β Logo image correctly referenced');
} else {
tests.failed.push('β Logo image missing or incorrect');
}
// Test 2: Phone number
if (content.includes('0439 222 665')) {
tests.passed.push('β Phone number updated to 0439 222 665');
} else {
tests.failed.push('β Phone number not updated');
}
// Test 3: Colors
if (content.includes("'battery-blue': '#002375'")) {
tests.passed.push('β Blue color updated to #002375');
} else {
tests.failed.push('β Blue color not updated');
}
if (content.includes("'battery-red': '#22C55E'")) {
tests.passed.push('β Red changed to green (#22C55E)');
} else {
tests.failed.push('β Red not changed to green');
}
if (content.includes("'battery-yellow': '#FFC107'")) {
tests.passed.push('β Yellow color updated to #FFC107');
} else {
tests.failed.push('β Yellow color not updated');
}
// Test 4: Navigation links
if (content.includes('href="services.html"')) {
tests.passed.push('β Services link in navigation');
} else if (file !== 'services.html') {
tests.failed.push('β Services link missing in navigation');
}
// Test 5: Free Quote button
if (content.includes('bg-battery-yellow text-black') && content.includes('Free Quote')) {
tests.passed.push('β Free Quote button styled correctly');
} else {
tests.failed.push('β Free Quote button styling incorrect');
}
testsPerFile.push(tests);
});
// Display results
console.log('\nπ TEST RESULTS BY FILE:\n');
testsPerFile.forEach(test => {
console.log(`\nπ ${test.file.toUpperCase()}`);
console.log('-'.repeat(40));
if (test.passed.length > 0) {
console.log('β
Passed Tests:');
test.passed.forEach(p => console.log(' ' + p));
}
if (test.failed.length > 0) {
console.log('β Failed Tests:');
test.failed.forEach(f => console.log(' ' + f));
}
console.log(`Score: ${test.passed.length}/${test.passed.length + test.failed.length}`);
});
// Summary
const totalPassed = testsPerFile.reduce((acc, t) => acc + t.passed.length, 0);
const totalFailed = testsPerFile.reduce((acc, t) => acc + t.failed.length, 0);
console.log('\n' + '='.repeat(50));
console.log('π OVERALL SUMMARY:');
console.log('='.repeat(50));
console.log(`β
Total Passed: ${totalPassed}`);
console.log(`β Total Failed: ${totalFailed}`);
console.log(`π Success Rate: ${((totalPassed / (totalPassed + totalFailed)) * 100).toFixed(1)}%`);
// Specific content checks
console.log('\n' + '='.repeat(50));
console.log('π SPECIFIC CONTENT VERIFICATION:\n');
// Check index.html for specific sections
const indexPath = path.join(__dirname, 'index.html');
if (fs.existsSync(indexPath)) {
const indexContent = fs.readFileSync(indexPath, 'utf8');
console.log('INDEX.HTML:');
console.log(indexContent.includes('Battery Brands We Supply') ? 'β Battery brands section present' : 'β Battery brands section missing');
console.log(indexContent.includes('photos/bosch logo.png') ? 'β Bosch logo present' : 'β Bosch logo missing');
console.log(indexContent.includes('photos/varta logo.jpg') ? 'β VARTA logo present' : 'β VARTA logo missing');
console.log(indexContent.includes('Customer Reviews Section') || indexContent.includes('What Our Customers Say') ? 'β Reviews section present' : 'β Reviews section missing');
console.log(indexContent.includes('Emergency Battery Service') && indexContent.includes('photos/emergency_vehicle_engine_repair.jpg') ? 'β Emergency section with background image' : 'β Emergency section issue');
}
// Check about.html for specific updates
const aboutPath = path.join(__dirname, 'about.html');
if (fs.existsSync(aboutPath)) {
const aboutContent = fs.readFileSync(aboutPath, 'utf8');
console.log('\nABOUT.HTML:');
console.log(!aboutContent.includes('Meet Our Expert Team') ? 'β Team section removed' : 'β Team section still present');
console.log(aboutContent.includes('Our Company Values') ? 'β Values section added' : 'β Values section missing');
console.log(aboutContent.includes('15,000+') && aboutContent.includes('Batteries Installed') ? 'β Stats updated to 15,000+' : 'β Stats not updated');
console.log(!aboutContent.includes('Awards & Recognition') ? 'β Awards section removed' : 'β Awards section still present');
}
// Check contact.html
const contactPath = path.join(__dirname, 'contact.html');
if (fs.existsSync(contactPath)) {
const contactContent = fs.readFileSync(contactPath, 'utf8');
console.log('\nCONTACT.HTML:');
console.log(!contactContent.includes('Stay Connected') ? 'β Stay Connected section removed' : 'β Stay Connected section still present');
}
// Check services.html
const servicesPath = path.join(__dirname, 'services.html');
if (fs.existsSync(servicesPath)) {
const servicesContent = fs.readFileSync(servicesPath, 'utf8');
console.log('\nSERVICES.HTML:');
console.log(!servicesContent.includes('Service Pricing') ? 'β Pricing section removed' : 'β Pricing section still present');
console.log(servicesContent.includes('bg-battery-blue text-white py-32') ? 'β Hero section styled like home page' : 'β Hero section styling different');
console.log(servicesContent.includes('Why Choose Us') ? 'β Why Choose Us section present' : 'β Why Choose Us section missing');
}
console.log('\n' + '='.repeat(50));
console.log('β
Website testing complete!');