File size: 1,376 Bytes
857cdcf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
const { defineConfig } = require('@playwright/test');

/**
 * Playwright Configuration for Chahuadev Framework E2E Testing
 * @see https://playwright.dev/docs/test-configuration
 */
module.exports = defineConfig({
    testDir: './tests',
    
    //  กำหนดไฟล์ทดสอบที่ต้องข้าม 
    testIgnore: [
        '**/*.system.spec.js',    // ทดสอบส่วนประกอบระบบภายใน
        '**/*.framework.spec.js', // ทดสอบ Framework เอง
        '**/fixtures*.spec.js' // ทดสอบในข้อมูลตัวอย่าง
    ],

    timeout: 30000,
    fullyParallel: false, // Electron apps ควรรันแบบ sequential
    workers: 1,
    reporter: [
        ['list'], 
        ['html', { outputFolder: 'test-results' }]
    ],
    
    use: {
        // Global test settings
        trace: 'on-first-retry',
        screenshot: 'only-on-failure',
        video: 'retain-on-failure',
    },

    projects: [
        {
            name: 'electron',
            //  ไม่ทดสอบไฟล์ระบบโดยตรง 
            testMatch: [
                'tests/app-behavior.spec.js',
                'tests/plugin-*.spec.js'
            ],
            use: {
                // Electron-specific settings
            }
        }
    ]
});