-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfinal_test.py
More file actions
213 lines (177 loc) · 6.17 KB
/
Copy pathfinal_test.py
File metadata and controls
213 lines (177 loc) · 6.17 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#!/usr/bin/env python3
"""
Final comprehensive test for the ShareConnect website
"""
import os
import re
def test_all_files_exist():
"""Test if all required files exist"""
required_files = [
"index.html",
"products.html",
"manuals.html",
"styles.css",
"script.js",
"qbitconnect.html",
"transmissionconnect.html",
"plexconnect.html",
"jellyfinconnect.html",
"embyconnect.html",
"jdownloaderconnect.html",
"ytdlpconnect.html",
"metubeconnect.html",
"nextcloudconnect.html",
"seafileconnect.html",
"filebrowserconnect.html",
"syncthingconnect.html",
"matrixconnect.html",
"paperlessngconnect.html",
"duplicaticonnect.html",
"wireguardconnect.html",
"minecraftserverconnect.html",
"onlyofficeconnect.html",
"shareconnector.html"
]
missing_files = []
for file in required_files:
if not os.path.exists(file):
missing_files.append(file)
return missing_files
def test_blue_theme():
"""Test if blue theme is properly implemented"""
blue_colors = ["#268AF8", "#3EC9D6", "#1e5f99"]
with open("styles.css", 'r', encoding='utf-8') as f:
css_content = f.read()
missing_colors = []
for color in blue_colors:
if color not in css_content:
missing_colors.append(color)
return missing_colors
def test_consumer_messaging():
"""Test if consumer-focused messaging is used"""
files_to_check = [
"index.html",
"products.html",
"qbitconnect.html",
"plexconnect.html",
"jdownloaderconnect.html"
]
technical_terms = [
"comprehensive Android application ecosystem",
"seamlessly connects your media discovery",
"professional integration"
]
consumer_terms = [
"one tap",
"instantly",
"easily",
"simple",
"works with",
"automatically",
"directly"
]
results = {}
for filename in files_to_check:
with open(filename, 'r', encoding='utf-8') as f:
content = f.read()
# Check for technical terms (should be minimal)
tech_count = sum(1 for term in technical_terms if term.lower() in content.lower())
# Check for consumer terms (should be plentiful)
consumer_count = sum(1 for term in consumer_terms if term.lower() in content.lower())
results[filename] = {
"technical_terms": tech_count,
"consumer_terms": consumer_count,
"passed": consumer_count > tech_count * 2 # More consumer terms than technical
}
return results
def test_mobile_responsive():
"""Test if mobile responsive features exist"""
with open("styles.css", 'r', encoding='utf-8') as f:
content = f.read()
responsive_features = [
"@media",
"max-width",
"flex-wrap",
"grid-template-columns"
]
missing_features = []
for feature in responsive_features:
if feature not in content:
missing_features.append(feature)
return missing_features
def test_links():
"""Test if all internal links work"""
import subprocess
result = subprocess.run(
["python3", "check_links.py"],
capture_output=True,
text=True
)
# Check if "All links are valid" is in output
return "All links are valid" in result.stdout
def main():
"""Run final comprehensive tests"""
print("🎯 Running Final Comprehensive Tests...\n")
all_passed = True
# Test 1: All files exist
print("📁 Test 1: All required files exist")
missing_files = test_all_files_exist()
if not missing_files:
print(" ✅ All files present")
else:
print(f" ❌ Missing files: {missing_files}")
all_passed = False
# Test 2: Blue theme
print("\n🎨 Test 2: Blue theme implemented")
missing_colors = test_blue_theme()
if not missing_colors:
print(" ✅ Blue theme colors found")
else:
print(f" ❌ Missing colors: {missing_colors}")
all_passed = False
# Test 3: Consumer messaging
print("\n💬 Test 3: Consumer-focused messaging")
messaging_results = test_consumer_messaging()
passed_count = sum(1 for result in messaging_results.values() if result["passed"])
total_count = len(messaging_results)
if passed_count == total_count:
print(f" ✅ All {total_count} files use consumer messaging")
else:
print(f" ❌ {passed_count}/{total_count} files use consumer messaging")
for filename, result in messaging_results.items():
if not result["passed"]:
print(f" - {filename}: {result['consumer_terms']} consumer vs {result['technical_terms']} technical terms")
all_passed = False
# Test 4: Mobile responsive
print("\n📱 Test 4: Mobile responsive design")
missing_features = test_mobile_responsive()
if not missing_features:
print(" ✅ Mobile responsive features found")
else:
print(f" ❌ Missing features: {missing_features}")
all_passed = False
# Test 5: Links work
print("\n🔗 Test 5: All internal links work")
links_work = test_links()
if links_work:
print(" ✅ All internal links are valid")
else:
print(" ❌ Some broken links found")
all_passed = False
# Final summary
print("\n" + "="*50)
print("📊 FINAL TEST SUMMARY")
print("="*50)
if all_passed:
print("🎉 SUCCESS: All tests passed!")
print("\nThe ShareConnect website is fully refined and ready for production.")
print("\n✅ Consumer-focused messaging")
print("✅ Professional blue theme")
print("✅ Mobile responsive design")
print("✅ All links working")
print("✅ Screenshots and video sections")
print("✅ All connector pages updated")
else:
print("⚠️ Some tests failed. Please review the issues above.")
if __name__ == "__main__":
main()