Skip to content

sanjaysarkar1997/qa-python-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

QA Analytics Dashboard

A Python-based interactive dashboard that reads daily test execution CSV reports and displays live charts, KPI cards, and filterable tables.

Built with Python ยท Dash ยท Plotly ยท Pandas


๐Ÿ“ Project Structure

qa-python-dashboard/
โ”‚
โ”œโ”€โ”€ app.py            โ† ๐Ÿš€ Start here โ€” runs the dashboard server
โ”œโ”€โ”€ config.py         โ† โš™๏ธ  All settings (colors, port, paths)
โ”œโ”€โ”€ data_loader.py    โ† ๐Ÿ“‚ Reads and cleans CSV files
โ”œโ”€โ”€ charts.py         โ† ๐Ÿ“Š Builds every chart / graph
โ”œโ”€โ”€ layout.py         โ† ๐Ÿ–ผ๏ธ  Defines the page structure
โ”œโ”€โ”€ callbacks.py      โ† ๐Ÿ”„ Handles user interactions
โ”‚
โ”œโ”€โ”€ reports/          โ† ๐Ÿ“‹ DROP YOUR CSV FILES HERE
โ”‚   โ”œโ”€โ”€ test-summary-2026-06-08.csv
โ”‚   โ”œโ”€โ”€ test-summary-2026-06-09.csv
โ”‚   โ””โ”€โ”€ test-summary-2026-06-10.csv
โ”‚
โ””โ”€โ”€ README.md

For interns: Each file has one job.

  • To change a color โ†’ edit config.py
  • To change how CSV data is read โ†’ edit data_loader.py
  • To change a chart โ†’ edit charts.py
  • To change the page layout โ†’ edit layout.py
  • To change what happens on a button click โ†’ edit callbacks.py

โš™๏ธ How CSV Files Are Loaded

The dashboard auto-discovers all *.csv files inside the reports/ folder.

You do not need to edit any code when adding a new report:

  1. Export your test summary as a CSV from your test runner
  2. Save it into the reports/ folder
  3. Restart the app (or wait for the 60-second auto-refresh)

The file name does not matter โ€” any .csv file in reports/ will be picked up.


๐Ÿ”ง Required CSV Columns

The dashboard expects these columns (column names are case-insensitive):

Column Required? Description
Test ID Optional Unique test identifier
Test Name โœ… Yes Human-readable test name
Status โœ… Yes Passed, Failed, Skipped, Broken
Start Time โœ… Yes When the test began
Stop Time Optional When the test ended
Duration (s) Optional Runtime in seconds
Monitor Status Optional High, Critical, Normal, etc.
Failure Root Cause Optional Why the test failed
Updated At Optional When the test was last updated
Created At Optional When the test was created

Note: If a column is missing from an older CSV, the dashboard fills in a safe default โ€” it will not crash.


๐Ÿš€ Installation & Setup

Why a virtual environment?
Modern Linux/Ubuntu systems block installing Python packages system-wide
(externally-managed-environment error). A virtual environment creates
an isolated Python sandbox just for this project โ€” safe and clean.

Step 1 โ€” Create a virtual environment (first time only)

Open a terminal inside the project folder and run:

# Navigate to the project folder
cd qa-python-dashboard

# Create the virtual environment (creates a .venv folder)
python3 -m venv .venv

Step 2 โ€” Install required packages

.venv/bin/pip install -r requirements.txt

You should see packages being downloaded and installed.
This only needs to be done once.

Step 3 โ€” Place CSV files in the reports/ folder

reports/
โ”œโ”€โ”€ test-summary-2026-06-08.csv
โ”œโ”€โ”€ test-summary-2026-06-09.csv
โ””โ”€โ”€ test-summary-2026-06-10.csv

Step 4 โ€” Run the dashboard

# Always use the venv Python to run the app
.venv/bin/python3 app.py

Windows users: use .venv\Scripts\python app.py instead

Expected output:

[app] Starting QA Analytics Dashboard...
[data_loader] Found 3 CSV file(s):
   โ€ข test-summary-2026-06-08.csv
   โ€ข test-summary-2026-06-09.csv
   โ€ข test-summary-2026-06-10.csv
[data_loader] Total rows after merge: 1,532
[app] Dashboard running at  โ†’  http://127.0.0.1:8052

Step 4 โ€” Open in browser

http://127.0.0.1:8052

๐Ÿ“Š Dashboard Features

๐Ÿ” Filters (top of page)

Filter What it does
FROM DATE Show only tests run on or after this date
TO DATE Show only tests run on or before this date

All charts update instantly when you change a filter.


๐Ÿงฎ KPI Cards

Five summary cards show at a glance:

Card Color Meaning
๐Ÿงช TOTAL Grey All test runs in the selected range
โœ… PASS Green Tests that passed
โŒ FAIL Red Tests that failed
โญ๏ธ SKIPPED Yellow Tests that were skipped
โš ๏ธ BROKEN Purple Tests marked as broken

๐Ÿ“ˆ Charts

Chart Description
Test Status Distribution Donut chart โ€” proportion of each status
Test Execution Duration Bar chart โ€” how long tests take (grouped into 10 s buckets)
Failed Tests Per Day Bar chart โ€” failure count per date
Daily Test Trend Line chart โ€” daily total, daily new, and daily updated
Monitor Status Breakdown Stacked bar โ€” HIGH / CRITICAL / MONITOR CLOSELY priority tests
Failure Root Cause Analysis Donut chart โ€” distribution of why tests failed

๐Ÿ“‹ Table Buttons

Button Shows
๐Ÿ†• View New Tests Date, Test ID, Test Name, Status, Duration
โœ๏ธ View Updated Tests Date, Updated At, Test ID, Test Name, Status
๐Ÿ“‹ Full Dataset Every column in the combined CSV data

The table supports:

  • Column sorting โ€” click any column header
  • Row filtering โ€” type in the filter row below headers
  • Pagination โ€” 15 rows per page by default

๐Ÿ” Auto-Refresh

The dashboard automatically reloads data every 60 seconds.

If you update a CSV while the dashboard is running, the new data will appear within the next refresh cycle โ€” no restart needed.

To force an immediate reload: change a filter value and change it back.


โš™๏ธ Configuration

Open config.py to change dashboard settings without touching any other file:

PORT = 8052                  # Change the server port
REFRESH_INTERVAL_MS = 60000  # Auto-refresh interval (milliseconds)
TABLE_PAGE_SIZE = 15         # Rows shown per page in the data table
PLOTLY_TEMPLATE = "plotly_white"  # Chart visual theme

๐Ÿ› Troubleshooting

ModuleNotFoundError: No module named 'dash'

Install dependencies:

pip install dash plotly pandas numpy

FileNotFoundError: Reports folder not found

Create the reports/ folder next to app.py and drop your CSV files in it:

mkdir reports

RuntimeError: No CSV files found in 'reports'

Make sure the folder contains at least one .csv file.


KeyError: 'START TIME'

The dashboard expects columns to be named exactly as listed in the Required CSV Columns table above. Check the actual column names in your CSV:

head -1 reports/your-file.csv

Dashboard shows 0 tests / empty charts

Check that:

  1. The DATE column is being parsed correctly (check Start Time column format)
  2. Your CSV uses one of the supported status values: Passed, Failed, Skipped, Broken

Port already in use

Change the port in config.py:

PORT = 8053   # or any free port

๐ŸŒ Default URL

http://127.0.0.1:8052

๐Ÿ“ For Developers / Interns โ€” How to Extend

Add a new chart

  1. Write a build_my_chart(df) function in charts.py
  2. Add a dcc.Graph(id="my_chart") to layout.py
  3. Add it to the Output list and return value in callbacks.py โ†’ update_dashboard()

Add a new filter

  1. Add the Dash component to layout.py
  2. Add an Input("my_filter", "value") to the callback in callbacks.py
  3. Apply the filter to df inside update_dashboard()

Change the color palette

Edit STATUS_COLORS and KPI_CARD_COLORS in config.py.
Changes automatically apply to all charts and KPI cards.


๐Ÿ›‘ Stopping the Dashboard

Press Ctrl + C in the terminal where the app is running.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors