-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinteractive_test.html
More file actions
552 lines (477 loc) · 18.5 KB
/
interactive_test.html
File metadata and controls
552 lines (477 loc) · 18.5 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧪 Elemental Arena - Interactive UX/UI Test</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
color: white;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
margin-bottom: 40px;
padding: 30px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.header h1 {
font-size: 2.5rem;
margin-bottom: 10px;
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.test-section {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 15px;
padding: 25px;
margin-bottom: 25px;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.test-section h2 {
font-size: 1.5rem;
margin-bottom: 20px;
color: #FFD700;
}
.test-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 15px;
margin-bottom: 10px;
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;
border-left: 4px solid transparent;
transition: all 0.3s ease;
}
.test-item:hover {
background: rgba(255, 255, 255, 0.1);
transform: translateX(5px);
}
.test-item.passed {
border-left-color: #4CAF50;
}
.test-item.failed {
border-left-color: #f44336;
}
.test-item.warning {
border-left-color: #FF9800;
}
.test-description {
flex: 1;
margin-right: 20px;
}
.test-status {
padding: 5px 15px;
border-radius: 20px;
font-weight: 600;
font-size: 0.9rem;
}
.status-pass {
background: #4CAF50;
}
.status-fail {
background: #f44336;
}
.status-warn {
background: #FF9800;
}
.test-controls {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.test-btn {
background: linear-gradient(135deg, #4CAF50, #45a049);
border: none;
color: white;
padding: 15px 25px;
border-radius: 10px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
transition: transform 0.2s;
text-decoration: none;
display: inline-block;
text-align: center;
}
.test-btn:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.test-btn.secondary {
background: linear-gradient(135deg, #2196F3, #1976D2);
}
.test-btn.warning {
background: linear-gradient(135deg, #FF9800, #F57C00);
}
.summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.summary-card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 15px;
padding: 20px;
text-align: center;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.summary-card h3 {
font-size: 2rem;
margin-bottom: 10px;
}
.iframe-container {
position: relative;
width: 100%;
height: 600px;
border-radius: 15px;
overflow: hidden;
margin-top: 20px;
border: 2px solid rgba(255, 255, 255, 0.2);
}
.iframe-container iframe {
width: 100%;
height: 100%;
border: none;
}
.test-notes {
background: rgba(255, 193, 7, 0.1);
border-left: 4px solid #FFC107;
padding: 15px;
border-radius: 5px;
margin-top: 20px;
}
@media (max-width: 768px) {
.container {
padding: 10px;
}
.header h1 {
font-size: 2rem;
}
.test-controls {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>🧪 Elemental Arena - Interactive UX/UI Test</h1>
<p>Comprehensive User Interface Testing</p>
</div>
<div class="test-controls">
<a href="http://localhost:3000/code-with-kiro-hackathon" target="_blank" class="test-btn">
🚀 Open Game (Dev)
</a>
<a href="http://localhost:8080" target="_blank" class="test-btn secondary">
📦 Open Game (Prod)
</a>
<button onclick="runAutomatedTests()" class="test-btn warning">
🤖 Run Automated Tests
</button>
<button onclick="toggleGameFrame()" class="test-btn secondary">
🖼️ Embedded View
</button>
</div>
<div class="summary">
<div class="summary-card">
<h3 id="passedCount">0</h3>
<p>✅ Passed</p>
</div>
<div class="summary-card">
<h3 id="failedCount">0</h3>
<p>❌ Errors</p>
</div>
<div class="summary-card">
<h3 id="warningCount">0</h3>
<p>⚠️ Warnings</p>
</div>
<div class="summary-card">
<h3 id="totalScore">0%</h3>
<p>📊 Overall Score</p>
</div>
</div>
<div id="gameFrame" style="display: none;">
<div class="iframe-container">
<iframe src="about:blank" id="gameIframe"></iframe>
</div>
</div>
<!-- Location Selection Tests -->
<div class="test-section">
<h2>🏟️ Location Selection Testing</h2>
<div class="test-item passed">
<div class="test-description">
<strong>Location Display</strong><br>
All locations (Free, Swamp, Village, Castle) are displayed correctly
</div>
<span class="test-status status-pass">✅ PASS</span>
</div>
<div class="test-item passed">
<div class="test-description">
<strong>Visual Cost Indication</strong><br>
Mana cost is displayed for each location
</div>
<span class="test-status status-pass">✅ PASS</span>
</div>
<div class="test-item warning">
<div class="test-description">
<strong>Insufficient Mana Availability</strong><br>
Locations with insufficient mana are visually dimmed (opacity: 0.5)
</div>
<span class="test-status status-warn">⚠️ WARN</span>
</div>
<div class="test-item failed">
<div class="test-description">
<strong>Keyboard Navigation</strong><br>
Missing support for Tab and Enter key selection
</div>
<span class="test-status status-fail">❌ FAIL</span>
</div>
</div>
<!-- Element Selection Tests -->
<div class="test-section">
<h2>⚔️ Element Selection Testing</h2>
<div class="test-item passed">
<div class="test-description">
<strong>Element Display</strong><br>
Earth, Water, Fire elements are displayed with emojis and names
</div>
<span class="test-status status-pass">✅ PASS</span>
</div>
<div class="test-item passed">
<div class="test-description">
<strong>Visual Feedback</strong><br>
Selected element receives 'selected' class
</div>
<span class="test-status status-pass">✅ PASS</span>
</div>
<div class="test-item warning">
<div class="test-description">
<strong>Progress Indicator</strong><br>
Shows correct step (2 of 2 for Free, 2 of 3 for paid)
</div>
<span class="test-status status-warn">⚠️ WARN</span>
</div>
<div class="test-item failed">
<div class="test-description">
<strong>Reference Information</strong><br>
Missing explanations of each element's advantages
</div>
<span class="test-status status-fail">❌ FAIL</span>
</div>
</div>
<!-- Elemental Selection Tests -->
<div class="test-section">
<h2>🌟 Elemental Selection Testing</h2>
<div class="test-item passed">
<div class="test-description">
<strong>Elemental Display</strong><br>
Cards show rarity, level and cooldown status
</div>
<span class="test-status status-pass">✅ PASS</span>
</div>
<div class="test-item warning">
<div class="test-description">
<strong>Cooldown System</strong><br>
Elementals on cooldown are blocked with visual indication
</div>
<span class="test-status status-warn">⚠️ WARN</span>
</div>
<div class="test-item failed">
<div class="test-description">
<strong>Real-time Updates</strong><br>
Cooldown timer doesn't update automatically
</div>
<span class="test-status status-fail">❌ FAIL</span>
</div>
<div class="test-item passed">
<div class="test-description">
<strong>Empty Collection</strong><br>
Informative message when no elementals are available
</div>
<span class="test-status status-pass">✅ PASS</span>
</div>
</div>
<!-- Collection Tests -->
<div class="test-section">
<h2>📦 Collection Testing</h2>
<div class="test-item passed">
<div class="test-description">
<strong>Filtering System</strong><br>
Element and rarity filters work correctly
</div>
<span class="test-status status-pass">✅ PASS</span>
</div>
<div class="test-item passed">
<div class="test-description">
<strong>Enhancement Modal Window</strong><br>
Shows cost, balance and confirmation
</div>
<span class="test-status status-pass">✅ PASS</span>
</div>
<div class="test-item warning">
<div class="test-description">
<strong>Elemental Sorting</strong><br>
Sorting by rarity works correctly
</div>
<span class="test-status status-warn">⚠️ WARN</span>
</div>
<div class="test-item failed">
<div class="test-description">
<strong>Collection Search</strong><br>
Missing search function for elementals by name
</div>
<span class="test-status status-fail">❌ FAIL</span>
</div>
</div>
<!-- Accessibility Tests -->
<div class="test-section">
<h2>♿ Accessibility Testing</h2>
<div class="test-item failed">
<div class="test-description">
<strong>ARIA-labels</strong><br>
Missing ARIA labels for screen readers
</div>
<span class="test-status status-fail">❌ FAIL</span>
</div>
<div class="test-item failed">
<div class="test-description">
<strong>Keyboard Navigation</strong><br>
No Tab and Enter support for all interactive elements
</div>
<span class="test-status status-fail">❌ FAIL</span>
</div>
<div class="test-item warning">
<div class="test-description">
<strong>Contrast</strong><br>
Some elements may have insufficient contrast
</div>
<span class="test-status status-warn">⚠️ WARN</span>
</div>
<div class="test-item failed">
<div class="test-description">
<strong>Semantic HTML Tags</strong><br>
Insufficient use of semantic elements
</div>
<span class="test-status status-fail">❌ FAIL</span>
</div>
</div>
<div class="test-notes">
<h3>📝 Testing Notes</h3>
<ul>
<li><strong>Overall UX/UI Rating:</strong> 8.5/10 - high quality with room for improvement</li>
<li><strong>Priority 1:</strong> Add accessibility support (ARIA, keyboard navigation)</li>
<li><strong>Priority 2:</strong> Implement real-time cooldown updates</li>
<li><strong>Priority 3:</strong> Add tutorial elements and help system</li>
<li><strong>Recommendation:</strong> Conduct testing with real users</li>
</ul>
</div>
</div>
<script>
let gameFrameVisible = false;
function updateSummary() {
const passed = document.querySelectorAll('.test-item.passed').length;
const failed = document.querySelectorAll('.test-item.failed').length;
const warnings = document.querySelectorAll('.test-item.warning').length;
const total = passed + failed + warnings;
document.getElementById('passedCount').textContent = passed;
document.getElementById('failedCount').textContent = failed;
document.getElementById('warningCount').textContent = warnings;
const score = total > 0 ? Math.round((passed / total) * 100) : 0;
document.getElementById('totalScore').textContent = score + '%';
}
function runAutomatedTests() {
alert('🤖 Automated tests launched!\n\nThis is a simulation - in reality, Selenium/Playwright tests would run here to check:\n• Element clickability\n• Interface responsiveness\n• Navigation correctness\n• Performance\n\nSee detailed report in ux_ui_analysis_report.md');
}
function toggleGameFrame() {
const frame = document.getElementById('gameFrame');
const iframe = document.getElementById('gameIframe');
gameFrameVisible = !gameFrameVisible;
if (gameFrameVisible) {
frame.style.display = 'block';
iframe.src = 'http://localhost:3000/code-with-kiro-hackathon';
document.querySelector('button[onclick="toggleGameFrame()"]').textContent = '🙈 Hide View';
} else {
frame.style.display = 'none';
iframe.src = 'about:blank';
document.querySelector('button[onclick="toggleGameFrame()"]').textContent = '🖼️ Embedded View';
}
}
// Server availability check
async function checkServerStatus() {
const servers = [
{ url: 'http://localhost:3000/code-with-kiro-hackathon', name: 'Development' },
{ url: 'http://localhost:8080', name: 'Production' }
];
for (const server of servers) {
try {
const response = await fetch(server.url, {
mode: 'no-cors',
method: 'HEAD'
});
console.log(`✅ ${server.name} server available`);
} catch (error) {
console.log(`❌ ${server.name} server unavailable:`, error.message);
}
}
}
// Initialization
document.addEventListener('DOMContentLoaded', function () {
updateSummary();
checkServerStatus();
// Add highlighting for active elements
document.querySelectorAll('.test-item').forEach(item => {
item.addEventListener('click', function () {
this.style.transform = 'scale(1.02)';
setTimeout(() => {
this.style.transform = '';
}, 200);
});
});
});
// Keyboard shortcuts
document.addEventListener('keydown', function (e) {
if (e.ctrlKey || e.metaKey) {
switch (e.key) {
case '1':
e.preventDefault();
window.open('http://localhost:3000/code-with-kiro-hackathon', '_blank');
break;
case '2':
e.preventDefault();
window.open('http://localhost:8080', '_blank');
break;
case 't':
e.preventDefault();
runAutomatedTests();
break;
case 'f':
e.preventDefault();
toggleGameFrame();
break;
}
}
});
</script>
</body>
</html>