PHP code example of vortechron / nightwatch-testing

1. Go to this page and download the library: Download vortechron/nightwatch-testing library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vortechron / nightwatch-testing example snippets


return [
    // User model for notification testing
    'user_model' => 'App\\Models\\User',

    // Internal endpoints to test
    'internal_endpoints' => [
        'success' => [
            ['method' => 'GET', 'path' => '/health', 'description' => 'Health check'],
        ],
        'redirect' => [
            ['method' => 'GET', 'path' => '/settings', 'description' => 'Settings redirect'],
        ],
        'client_error' => [
            ['method' => 'GET', 'path' => '/api/user', 'expected_status' => [401, 403]],
        ],
    ],

    // Mail test recipients
    'mail' => [
        'to' => '[email protected]',
        'cc' => '[email protected]',
    ],

    // Outgoing request test URL
    'outgoing_request_url' => 'https://httpbin.org',
];
bash
php artisan vendor:publish --tag=nightwatch-testing-config
bash
php artisan nightwatch:test