-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.html
More file actions
363 lines (312 loc) Β· 13.8 KB
/
test.html
File metadata and controls
363 lines (312 loc) Β· 13.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Insurance Widget - Quick Test Page</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
margin: 0;
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
}
.test-container {
max-width: 1000px;
margin: 0 auto;
background: white;
border-radius: 12px;
padding: 30px;
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
.header {
text-align: center;
margin-bottom: 30px;
}
.header h1 {
color: #333;
margin-bottom: 10px;
}
.header p {
color: #666;
font-size: 18px;
}
.test-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
margin-bottom: 30px;
}
.widget-panel {
background: #f8f9fa;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.widget-panel iframe {
width: 100%;
height: 500px;
border: none;
display: block;
}
.test-panel {
background: #f8f9fa;
border-radius: 8px;
padding: 20px;
}
.test-item {
background: white;
border-radius: 6px;
padding: 15px;
margin-bottom: 15px;
border-left: 4px solid #20585C;
}
.test-item h4 {
margin: 0 0 10px 0;
color: #333;
}
.test-item p {
margin: 0;
color: #666;
font-size: 14px;
}
.status {
display: inline-block;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
margin-left: 10px;
}
.status.working { background: #d4edda; color: #155724; }
.status.testing { background: #fff3cd; color: #856404; }
.events-log {
background: #2d3748;
color: #e2e8f0;
border-radius: 6px;
padding: 15px;
font-family: 'Courier New', monospace;
font-size: 12px;
height: 200px;
overflow-y: auto;
margin-top: 15px;
}
.quick-tests {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin-top: 20px;
}
.quick-test {
background: white;
border: 2px solid #e2e8f0;
border-radius: 8px;
padding: 15px;
text-align: center;
transition: all 0.2s;
}
.quick-test:hover {
border-color: #20585C;
transform: translateY(-2px);
}
.quick-test h5 {
margin: 0 0 10px 0;
color: #333;
}
.quick-test p {
margin: 0;
color: #666;
font-size: 13px;
}
@media (max-width: 768px) {
.test-grid {
grid-template-columns: 1fr;
}
.widget-panel iframe {
height: 400px;
}
}
</style>
</head>
<body>
<!-- Demo Navigation - Outside container -->
<div style="position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px;">
<a href="/" target="_blank" style="display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #20585C; color: white; border-radius: 50%; text-decoration: none; box-shadow: 0 4px 8px rgba(0,0,0,0.2); transition: all 0.2s;" title="Main Widget">
π
</a>
<a href="/demo.html" target="_blank" style="display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #F4A63A; color: white; border-radius: 50%; text-decoration: none; box-shadow: 0 4px 8px rgba(0,0,0,0.2); transition: all 0.2s;" title="Integration Demo">
π
</a>
<a href="/test.html" style="display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #327233; color: white; border-radius: 50%; text-decoration: none; box-shadow: 0 4px 8px rgba(0,0,0,0.2); transition: all 0.2s;" title="Quick Test">
π§ͺ
</a>
</div>
<div class="test-container">
<div class="header">
<h1>Insurance Widget Test Page</h1>
<p>Quick demonstration of iframe integration capabilities</p>
</div>
<div class="test-grid">
<div class="widget-panel">
<iframe
src="https://insurance-widget.vercel.app/"
id="test-widget"
title="Insurance Widget Test">
</iframe>
</div>
<div class="test-panel">
<h3>π Test Checklist</h3>
<div class="test-item">
<h4>Widget Loads <span class="status working">β Working</span></h4>
<p>Insurance widget loads correctly in iframe</p>
</div>
<div class="test-item" id="step-navigation-test">
<h4>Step Navigation <span class="status testing" id="step-nav-status">β³ Testing</span></h4>
<p>Navigate through all 4 steps and watch events below</p>
</div>
<div class="test-item">
<h4>Responsive Design <span class="status working">β Working</span></h4>
<p>Resize browser window to test mobile compatibility</p>
</div>
<div class="test-item" id="form-validation-test">
<h4>Form Validation <span class="status testing" id="form-validation-status">β³ Testing</span></h4>
<p><strong>Test:</strong> Click "Continue" or "Next" with empty fields in any step</p>
<p><strong>Expected:</strong> Should trigger validation events and show as β Tested</p>
</div>
<div class="test-item" id="completion-test">
<h4>Application Completion <span class="status testing" id="completion-status">β³ Testing</span></h4>
<p>Complete the full application process</p>
</div>
<h4>π‘ Live Events</h4>
<div class="events-log" id="events-log">
Waiting for widget events...
</div>
</div>
</div>
<div class="quick-tests">
<div class="quick-test">
<h5> Business Value</h5>
<p>Saves in development costs for small insurance firms</p>
</div>
<div class="quick-test">
<h5> Easy Integration</h5>
<p>One iframe tag works in WordPress, Squarespace, any website</p>
</div>
<div class="quick-test">
<h5> Mobile Ready</h5>
<p>Responsive design adapts to all screen sizes automatically</p>
</div>
<div class="quick-test">
<h5> Secure & Compliant</h5>
<p>HTTPS encrypted, GDPR compliant, secure messaging</p>
</div>
<div class="quick-test">
<h5> Professional UI</h5>
<p>Material Design components, custom theming, brand integration</p>
</div>
<div class="quick-test">
<h5>Event Tracking</h5>
<p>Real-time notifications, analytics integration, progress tracking</p>
</div>
</div>
<div style="margin-top: 30px; padding: 20px; background: #e8f4f8; border-radius: 8px; border-left: 4px solid #20585C;">
<h3> Interview Demo Points</h3>
<ul>
<li><strong>Problem:</strong> Small insurance firms can't afford custom development</li>
<li><strong>Solution:</strong> Professional widget they can embed anywhere with one line of code</li>
<li><strong>Technology:</strong> React + TypeScript + Redux + Material UI for enterprise-grade quality</li>
<li><strong>Business Model:</strong> SaaS subscription </li>
<li><strong>Competitive Edge:</strong> Zero technical barrier, instant deployment, professional results</li>
</ul>
</div>
</div>
<script>
const eventsLog = document.getElementById('events-log');
let eventCount = 0;
let stepsVisited = new Set();
let formValidationTested = false;
let applicationCompleted = false;
function updateTestStatus(testId, statusId, status, text) {
const statusEl = document.getElementById(statusId);
if (statusEl) {
statusEl.className = `status ${status}`;
statusEl.textContent = text;
}
}
function addEvent(message) {
eventCount++;
const timestamp = new Date().toLocaleTimeString();
const eventElement = document.createElement('div');
eventElement.innerHTML = `<span style="color: #4ade80;">[${timestamp}]</span> ${message}`;
eventsLog.insertBefore(eventElement, eventsLog.firstChild);
// Keep only last 20 events
while (eventsLog.children.length > 20) {
eventsLog.removeChild(eventsLog.lastChild);
}
}
// Listen for widget events
window.addEventListener('message', function(event) {
if (event.data.source === 'insurance-onboarding-widget') {
switch(event.data.type) {
case 'ONBOARDING_STEP_CHANGE':
const step = event.data.payload.step;
stepsVisited.add(step);
addEvent(`π Step ${step}: ${event.data.payload.stepName}`);
// Update step navigation status
if (stepsVisited.size >= 4) {
updateTestStatus('step-navigation-test', 'step-nav-status', 'working', 'β All Steps');
} else if (stepsVisited.size >= 2) {
updateTestStatus('step-navigation-test', 'step-nav-status', 'testing', `β³ ${stepsVisited.size}/4 Steps`);
}
break;
case 'ONBOARDING_COMPLETE':
applicationCompleted = true;
addEvent('π <span style="color: #fbbf24;">Application completed successfully!</span>');
updateTestStatus('completion-test', 'completion-status', 'working', 'β Completed');
// Mark step navigation as complete if not already
updateTestStatus('step-navigation-test', 'step-nav-status', 'working', 'β Completed');
break;
case 'RESIZE_REQUEST':
addEvent(`π Resize requested: ${event.data.payload.height}px`);
// Auto-resize iframe
const iframe = document.getElementById('test-widget');
if (iframe) {
iframe.style.height = Math.min(event.data.payload.height, 600) + 'px';
}
break;
case 'ERROR':
// Check if it's form validation related
if (event.data.payload.field) {
formValidationTested = true;
addEvent(`β οΈ <span style="color: #f59e0b;">Field validation: ${event.data.payload.field} - ${event.data.payload.message}</span>`);
updateTestStatus('form-validation-test', 'form-validation-status', 'working', 'β Tested');
} else {
addEvent(`β <span style="color: #f87171;">Error: ${event.data.payload.error || event.data.payload.message}</span>`);
}
break;
default:
addEvent(`π¨ Event: ${event.data.type}`);
}
}
});
// Send config when widget loads
document.getElementById('test-widget').addEventListener('load', function() {
addEvent(' <span style="color: #60a5fa;">Widget loaded successfully</span>');
setTimeout(() => {
this.contentWindow.postMessage({
source: 'insurance-parent-site',
type: 'CONFIG',
payload: {
brandColor: '#20585C',
companyName: 'Demo Insurance Co.'
}
}, '*');
addEvent('βοΈ Configuration sent to widget');
}, 1000);
});
// Initial message
addEvent('π Monitoring widget events...');
</script>
</body>
</html>