This project is designed to run k6 load tests instantly and flexibly with premium visual reporting.
- k6 installed on your system (accessible via command line).
- PowerShell or Command Prompt.
tests/: Contains workload configurations (smoke, slow, hard, spike, soak).utils/: Helper modules for HTTP, environment variables, and report generation.reports/: Storage for test results (HTML and JSON).k6.bat: Main command wrapper to execute tests.
Use the .\k6 command with the following format:
.\k6 [test_name] [target_url] [paths_list] [api_key]- Running a Smoke Test on Root:
.\k6 smoke http://localhost:3000- Running a Test on Multiple Endpoints Simultaneously:
.\k6 smoke http://localhost:3000 tracks,albums,users- Running a Test with an API Key:
.\k6 smoke http://localhost:3000 tracks,albums secret123- Running a Hard Test (Stress Test) for specific endpoints:
.\k6 hard http://localhost:3000 login,profile- View the HTML Report (File mode):
.\k6 report- View the HTML Report (Server mode - Recommended for logs):
.\k6 server- Cleaning the Reports Folder:
.\k6 cleanIf you prefer using npm, you can use these shortcuts:
npm run k6 -- smoke http://localhost:3000(Run test)npm run report(Open file directly)npm run server(Live preview with logs)npm run clean(Clear all report files)
- smoke: 1 user, 10s duration. Best for quick verification if the API is up.
- slow: Constant arrival rate configuration. Best for long-term stability testing.
- hard: Stress test with gradual load increases up to high levels.
- spike: Sudden traffic surges to test server resilience against unexpected shocks.
- soak: Sustained medium load over long durations to find memory leaks.
After each test execution, a premium visual report is automatically updated at:
reports/summary.html
Open this file in your browser to see latency statistics (P95), success rates, and other metrics in a modern dark-mode dashboard.
If arguments are not fully provided, the system uses these defaults:
- Test Name: (Required)
- Target URL: (Required)
- Paths List:
/(root) - API Key: Uses the default value from
utils/env.js
