-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_debug_test.js
More file actions
70 lines (52 loc) · 2.43 KB
/
Copy pathserver_debug_test.js
File metadata and controls
70 lines (52 loc) · 2.43 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
const { chromium } = require('playwright');
async function testServerDebug() {
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
try {
console.log('🚀 Starting server debug test...');
// Navigate to the application
console.log('📱 Navigating to http://localhost:3029');
await page.goto('http://localhost:3029');
// Wait for the application to load
await page.waitForSelector('canvas', { timeout: 10000 });
console.log('✅ Application loaded successfully');
// Wait a moment for the scene to fully initialize
await page.waitForTimeout(2000);
// Click "Add Text Layer" button
console.log('📝 Adding text layer...');
await page.click('button:has-text("Add Text Layer")');
// Wait for the text input modal to appear
await page.waitForSelector('#textInput', { timeout: 5000 });
// Enter the test text
console.log('✏️ Entering text "Server Debug"');
await page.fill('#textInput', 'Server Debug');
// Click confirm to add the text layer
await page.click('button:has-text("Confirm")');
console.log('✅ Text layer added');
// Wait a moment for the layer to be added
await page.waitForTimeout(1000);
// Click the "Submit Order" button
console.log('📤 Submitting order...');
await page.click('button:has-text("Submit Order")');
// Wait for the order form modal to appear
await page.waitForSelector('input[name="name"]', { timeout: 5000 });
// Fill out the order form
console.log('📋 Filling order form...');
await page.fill('input[name="name"]', 'Test User');
await page.fill('input[name="email"]', 'test@example.com');
await page.fill('input[name="phone"]', '555-1234');
await page.fill('textarea[name="notes"]', 'Server debug test order');
// Submit the form
console.log('🚀 Submitting form...');
await page.click('button[type="submit"]');
// Wait for the submission to complete
await page.waitForTimeout(3000);
console.log('✅ Test completed successfully');
console.log('📊 Check the server logs for file reception details');
} catch (error) {
console.error('❌ Test failed:', error.message);
} finally {
await browser.close();
}
}
testServerDebug();