16 KiB
Testing Guide: Dashboard & Rules Pages
This guide covers manual testing of the newly implemented dashboard and rules management pages in the Attune Web UI.
Prerequisites
1. Backend Services Running
You need the following services running:
# Terminal 1: PostgreSQL (if not running as service)
docker run -d --name attune-postgres \
-e POSTGRES_PASSWORD=attune \
-e POSTGRES_USER=attune \
-e POSTGRES_DB=attune \
-p 5432:5432 postgres:14
# Terminal 2: RabbitMQ (if not running as service)
docker run -d --name attune-rabbitmq \
-p 5672:5672 -p 15672:15672 \
rabbitmq:3.12-management
# Terminal 3: API Server
cd crates/api
cargo run
# Should start on http://localhost:8080
2. Test Data
Create test data using the CLI or API:
# Using the CLI
cd crates/cli
# Create a test pack
cargo run -- pack create \
--name test-pack \
--version 1.0.0 \
--description "Test pack for UI testing"
# Create a test action
cargo run -- action create \
--pack test-pack \
--name test-action \
--entry-point "echo 'Hello World'" \
--runner-type local.shell.command
# Create a test trigger
cargo run -- trigger create \
--pack test-pack \
--name test-trigger \
--description "Manual test trigger"
# Create a test rule
cargo run -- rule create \
--pack test-pack \
--name test-rule \
--trigger test-trigger \
--action test-action \
--description "Test automation rule"
# Execute the action to create execution records
cargo run -- action execute test-pack.test-action
cargo run -- action execute test-pack.test-action
cargo run -- action execute test-pack.test-action
3. Web UI Running
# Terminal 4: Web UI Dev Server
cd web
npm install # First time only
npm run dev
# Should start on http://localhost:5173
4. Login Credentials
Default test user (if seeded):
- Username:
admin - Password:
admin
Or create a user via API/CLI if needed.
Dashboard Testing
Test 1: Initial Load
Objective: Verify dashboard loads with correct metrics.
Steps:
- Navigate to
http://localhost:5173 - Login if not authenticated
- Should automatically redirect to dashboard
Expected Results:
- ✅ Dashboard page loads without errors
- ✅ Four metric cards display at top
- ✅ Each metric shows a number (not "—" or "Loading...")
- ✅ Metric counts match actual data:
- Total Packs: should show 1+ (your test packs)
- Active Rules: should show count of enabled rules
- Running Executions: likely 0 (unless something is running)
- Total Actions: should show 1+ (your test actions)
Test 2: Live Connection Indicator
Objective: Verify SSE connection status is shown.
Steps:
- On dashboard, look for "Welcome back" message
- Next to it should be a "Live" indicator
Expected Results:
- ✅ Green pulsing dot visible
- ✅ "Live" text displayed in green
- ✅ If API is stopped, indicator should disappear within 30s
Test 3: Metric Card Navigation
Objective: Verify clicking metrics navigates to correct pages.
Steps:
- Click "Total Packs" card → should go to
/packs - Go back, click "Active Rules" card → should go to
/rules - Go back, click "Running Executions" card → should go to
/executions - Go back, click "Total Actions" card → should go to
/actions
Expected Results:
- ✅ Each click navigates to correct page
- ✅ Hover effect shows on cards (shadow increases)
- ✅ Cursor shows pointer on hover
Test 4: Status Distribution Chart
Objective: Verify execution status visualization.
Steps:
- Look at "Execution Status" section (left side, below metrics)
- Should show status breakdown with progress bars
Expected Results:
- ✅ Status categories listed (succeeded, failed, running, etc.)
- ✅ Counts displayed for each status
- ✅ Progress bars show percentage visually
- ✅ Colors match status (green=succeeded, red=failed, blue=running)
- ✅ Success rate displayed at bottom
- ✅ If no executions: "No executions yet" message
Test 5: Recent Activity Feed
Objective: Verify execution activity list.
Steps:
- Look at "Recent Activity" section (right side, 2 columns wide)
- Should show list of recent executions
Expected Results:
- ✅ Up to 20 executions displayed
- ✅ Each shows: pack.action name, status badge, ID, time, elapsed time
- ✅ Clicking an item navigates to execution detail page
- ✅ Hover effect highlights row
- ✅ "View all →" link goes to executions page
- ✅ If no executions: "No recent activity" message
Test 6: Real-Time Updates
Objective: Verify SSE updates dashboard in real-time.
Steps:
- Keep dashboard open in browser
- In terminal, execute an action:
cargo run -- action execute test-pack.test-action - Watch the dashboard
Expected Results:
- ✅ Recent Activity updates within 1-2 seconds
- ✅ New execution appears at top of list
- ✅ Running Executions count updates if execution is in progress
- ✅ Status distribution updates when execution completes
- ✅ No page reload required
- ✅ "Live" indicator stays green throughout
Test 7: Quick Actions Section
Objective: Verify navigation cards at bottom.
Steps:
- Scroll to bottom of dashboard
- Should see "Quick Actions" section with 3 cards
Expected Results:
- ✅ Three cards: "Manage Packs", "Browse Actions", "Configure Rules"
- ✅ Each has an icon and description
- ✅ Hover effect shows (shadow increases)
- ✅ Clicking navigates to correct page
Test 8: Responsive Layout
Objective: Verify layout adapts to screen size.
Steps:
- Resize browser window from wide to narrow
- Observe metric cards layout
Expected Results:
- ✅ Desktop (>1024px): 4 columns of metrics
- ✅ Tablet (768-1024px): 2 columns of metrics
- ✅ Mobile (<768px): 1 column of metrics
- ✅ Status chart and activity feed stack on mobile
- ✅ No horizontal scrolling at any size
Rules Pages Testing
Test 9: Rules List - Initial Load
Objective: Verify rules list page displays correctly.
Steps:
- Navigate to
/rulesor click "Configure Rules" from dashboard - Should see rules list page
Expected Results:
- ✅ Page title "Rules" visible
- ✅ Description text visible
- ✅ Filter buttons visible (All Rules, Enabled, Disabled)
- ✅ "Create Rule" button visible (disabled/placeholder for now)
- ✅ Result count shows "Showing X of Y rules"
- ✅ Table with headers: Rule, Pack, Trigger, Action, Status, Actions
- ✅ Test rule visible in table
Test 10: Rules List - Filtering
Objective: Verify filtering works correctly.
Steps:
- On rules list page, note initial count
- Click "Enabled" filter button
- Note filtered count
- Click "Disabled" filter button
- Click "All Rules" button
Expected Results:
- ✅ "Enabled" shows only enabled rules
- ✅ "Disabled" shows only disabled rules
- ✅ "All Rules" shows all rules
- ✅ Active filter button highlighted in blue
- ✅ Inactive buttons are gray
- ✅ Count updates correctly with each filter
Test 11: Rules List - Toggle Enable/Disable
Objective: Verify inline status toggle.
Steps:
- On rules list, find a rule with "Enabled" status
- Click the green "Enabled" badge
- Wait for update
- Observe status change
Expected Results:
- ✅ Badge shows loading state briefly
- ✅ Status changes to "Disabled" (gray badge)
- ✅ Clicking again toggles back to "Enabled"
- ✅ No page reload
- ✅ If "Enabled" filter active, rule disappears from list after disable
Test 12: Rules List - Delete Rule
Objective: Verify rule deletion.
Steps:
- On rules list, click "Delete" button for a test rule
- Confirmation dialog appears
- Click "Cancel" first
- Click "Delete" again
- Click "OK" to confirm
Expected Results:
- ✅ Confirmation dialog shows rule name
- ✅ Cancel does nothing
- ✅ OK removes rule from list
- ✅ Count updates
- ✅ No page reload
Test 13: Rules List - Pagination
Objective: Verify pagination controls (if >20 rules).
Steps:
- Create 25+ rules (if needed)
- On rules list, observe pagination controls at bottom
- Click "Next" button
- Click "Previous" button
Expected Results:
- ✅ Pagination only shows if >20 rules
- ✅ "Page X of Y" displayed
- ✅ "Next" disabled on last page
- ✅ "Previous" disabled on first page
- ✅ Navigation works correctly
Test 14: Rule Detail - Basic Information
Objective: Verify rule detail page displays all info.
Steps:
- From rules list, click a rule name
- Should navigate to
/rules/:id
Expected Results:
- ✅ "← Back to Rules" link at top
- ✅ Rule name as page title
- ✅ Status badge (Enabled/Disabled) next to title
- ✅ Description visible (if set)
- ✅ Metadata: ID, created date, updated date
- ✅ Enable/Disable button at top right
- ✅ Delete button at top right
Test 15: Rule Detail - Overview Card
Objective: Verify overview section content.
Steps:
- On rule detail page, find "Overview" card (left side)
- Check displayed information
Expected Results:
- ✅ Pack name displayed as clickable link
- ✅ Trigger name displayed
- ✅ Action name displayed as clickable link
- ✅ Clicking pack link goes to
/packs/:name - ✅ Clicking action link goes to
/actions/:id
Test 16: Rule Detail - Criteria Display
Objective: Verify criteria JSON display (if rule has criteria).
Steps:
- On rule detail, look for "Match Criteria" card
- Should show JSON formatted criteria
Expected Results:
- ✅ Card only appears if criteria exists
- ✅ JSON is formatted with indentation
- ✅ Displayed in monospace font
- ✅ Gray background for readability
- ✅ Scrollable if content is long
Test 17: Rule Detail - Action Parameters
Objective: Verify action parameters display.
Steps:
- On rule detail, look for "Action Parameters" card
- Should show JSON formatted parameters
Expected Results:
- ✅ Card only appears if parameters exist
- ✅ JSON is formatted with indentation
- ✅ Displayed in monospace font
- ✅ Gray background for readability
- ✅ Scrollable if content is long
Test 18: Rule Detail - Quick Links Sidebar
Objective: Verify quick links functionality.
Steps:
- On rule detail, find "Quick Links" card (right sidebar)
- Try clicking each link
Expected Results:
- ✅ "View Pack" link works
- ✅ "View Action" link works
- ✅ "View Trigger" link works (may 404 if triggers page not implemented)
- ✅ "View Enforcements" link works (may 404 if enforcements page not implemented)
Test 19: Rule Detail - Metadata Sidebar
Objective: Verify metadata display.
Steps:
- On rule detail, find "Metadata" card (right sidebar)
- Check all fields
Expected Results:
- ✅ Rule ID in monospace font
- ✅ Pack ID in monospace font
- ✅ Trigger ID in monospace font
- ✅ Action ID in monospace font
- ✅ Created timestamp in readable format
- ✅ Last Updated timestamp in readable format
Test 20: Rule Detail - Status Card
Objective: Verify status display and warnings.
Steps:
- On rule detail, find "Status" card (right sidebar)
- If rule is disabled, should show warning
Expected Results:
- ✅ Status badge shows "Active" or "Inactive"
- ✅ Color matches enabled state (green/gray)
- ✅ If disabled: warning message displayed
- ✅ Warning text explains rule won't trigger
Test 21: Rule Detail - Enable/Disable Toggle
Objective: Verify status toggle on detail page.
Steps:
- On rule detail page, click Enable/Disable button
- Watch for status update
- Toggle back
Expected Results:
- ✅ Button shows loading state ("Processing...")
- ✅ Status badge updates after success
- ✅ Button text changes (Enable ↔ Disable)
- ✅ Button color changes (green ↔ gray)
- ✅ Status card updates
- ✅ No page reload
Test 22: Rule Detail - Delete Rule
Objective: Verify rule deletion from detail page.
Steps:
- On rule detail page, click "Delete" button
- Confirmation dialog appears
- Click "OK"
Expected Results:
- ✅ Confirmation dialog shows rule name
- ✅ After confirmation, redirects to
/ruleslist - ✅ Rule no longer in list
- ✅ No errors
Error Handling Testing
Test 23: Network Error Handling
Objective: Verify graceful handling of network errors.
Steps:
- Stop the API server
- Refresh dashboard or rules page
- Wait for timeout
Expected Results:
- ✅ Loading spinner shows while attempting
- ✅ Error message displayed after timeout
- ✅ "Live" indicator disappears
- ✅ Page doesn't crash
- ✅ Can navigate to other pages
Test 24: Invalid Rule ID
Objective: Verify handling of non-existent rule.
Steps:
- Navigate to
/rules/99999(non-existent ID)
Expected Results:
- ✅ Error message displayed
- ✅ "Rule not found" or similar message
- ✅ "Back to Rules" link provided
- ✅ No page crash
Test 25: SSE Reconnection
Objective: Verify SSE reconnects after interruption.
Steps:
- Open dashboard with "Live" indicator active
- Stop API server
- Wait 30 seconds (indicator should disappear)
- Restart API server
- Wait up to 30 seconds
Expected Results:
- ✅ "Live" indicator disappears when connection lost
- ✅ Dashboard still usable (cached data)
- ✅ "Live" indicator reappears after reconnection
- ✅ Updates resume automatically
Performance Testing
Test 26: Dashboard Load Time
Objective: Verify dashboard loads quickly.
Steps:
- Open browser DevTools → Network tab
- Clear cache and reload dashboard
- Observe load time
Expected Results:
- ✅ Initial load < 2 seconds (with warm backend)
- ✅ Metrics appear < 3 seconds
- ✅ No excessive API calls (should be ~5 requests)
Test 27: Large Rules List
Objective: Verify performance with many rules.
Steps:
- Create 100+ rules (if feasible)
- Navigate to rules list page
- Scroll through list
Expected Results:
- ✅ Page loads in reasonable time (< 3s)
- ✅ Only 20 items per page (pagination working)
- ✅ Smooth scrolling
- ✅ No lag when changing pages
Cross-Browser Testing
Test 28: Browser Compatibility
Objective: Verify works in major browsers.
Browsers to test: Chrome, Firefox, Safari, Edge
Steps:
- Open dashboard in each browser
- Test basic navigation
- Test real-time updates
Expected Results:
- ✅ Layout looks correct in all browsers
- ✅ All functionality works
- ✅ SSE connection works (all support EventSource)
- ✅ No console errors
Accessibility Testing
Test 29: Keyboard Navigation
Objective: Verify keyboard accessibility.
Steps:
- Navigate dashboard using only Tab key
- Press Enter on focused elements
Expected Results:
- ✅ All interactive elements focusable
- ✅ Focus indicator visible
- ✅ Logical tab order
- ✅ Enter key activates buttons/links
Test 30: Screen Reader Testing
Objective: Verify screen reader compatibility (basic).
Steps:
- Use browser's reader mode or screen reader
- Navigate dashboard and rules pages
Expected Results:
- ✅ Headings properly announced
- ✅ Button labels descriptive
- ✅ Link text meaningful
- ✅ Form controls labeled
Reporting Issues
If you find any issues during testing:
- Check console (F12 → Console tab) for errors
- Note exact steps to reproduce
- Screenshot if visual issue
- Browser/OS information
- Create issue in project tracker or document in
work-summary/PROBLEMS.md
Success Criteria
All tests passing means:
- ✅ Dashboard displays live metrics correctly
- ✅ Real-time updates work via SSE
- ✅ Rules CRUD operations fully functional
- ✅ Navigation flows work seamlessly
- ✅ Error handling is graceful
- ✅ Performance is acceptable
- ✅ Cross-browser compatible
- ✅ Accessible to keyboard users
Next Steps After Testing
Once all tests pass:
- Document any bugs found in PROBLEMS.md
- Fix critical issues
- Consider visual enhancements (charts library, animations)
- Move on to Events/Triggers/Sensors pages
- Implement create/edit forms for packs, actions, rules