-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-scanner.js
More file actions
49 lines (44 loc) · 1.48 KB
/
test-scanner.js
File metadata and controls
49 lines (44 loc) · 1.48 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
// Test script to verify Scanner component implementation
const fs = require('fs');
// Create a new flow with a Scanner component
const createTestFlow = async () => {
try {
// Wait for the application to be ready
console.log('Creating a test flow with a Scanner component...');
// Create a new flow
const flow = {
id: 'test-scanner-flow',
'url-key': 'test-scanner-flow',
name: 'Test Scanner Flow',
title: {
de: 'Test Scanner Flow',
en: 'Test Scanner Flow'
},
icon: 'mdiFileOutline',
pages_edit: [
{
pattern_type: 'Page',
id: 'page-1',
title: {
de: 'Scanner Test',
en: 'Scanner Test'
},
elements: []
}
],
pages_view: []
};
// Save the flow to a file
fs.writeFileSync('test-scanner-flow.json', JSON.stringify(flow, null, 2));
console.log('Test flow created and saved to test-scanner-flow.json');
console.log('Instructions:');
console.log('1. Open the application in your browser');
console.log('2. Click "Open" and select the test-scanner-flow.json file');
console.log('3. Add a Scanner component to the page');
console.log('4. Verify that the Scanner component includes all the required subflows');
console.log('5. Save the flow to verify that the JSON structure is correct');
} catch (error) {
console.error('Error creating test flow:', error);
}
};
createTestFlow();