5.4 KiB
5.4 KiB
Testing Guide - Kill Process on Disconnect
Quick Test Steps
Test 1: Verify Initial State
- Run the application
- Open Settings (File ? Settings)
- Navigate to "Pianobar Config & Auth" tab
- Verify:
- "Enable Profile Credentials and Custom Config Generation" checkbox is unchecked
- "Kill process" checkbox is disabled (grayed out, cannot be clicked)
- Config file path field is disabled
- Browse button is disabled
- Username field is disabled
- Password field is disabled
Test 2: Enable Override and Kill Process
- Check "Enable Profile Credentials and Custom Config Generation"
- Verify:
- "Kill process" checkbox becomes enabled
- All credential fields become enabled
- Check "Kill process" checkbox
- Click Save
- Re-open Settings
- Verify:
- "Enable Profile Credentials..." remains checked
- "Kill process" checkbox remains checked
- Setting persists correctly
Test 3: Connect and Kill on Disconnect
- Ensure a profile with Kill Process enabled is active
- Set Pianobar executable path if not already set
- Click Connect
- Verify:
- Pianobar starts (status shows "Connected to Pianobar")
- PID is displayed in status bar (e.g., "PID: 12345")
- Click Disconnect
- Verify:
- Status shows "Pianobar process killed (PID: XXXX)"
- Pianobar process is terminated (check Task Manager)
Test 4: Connect and Detach on Disconnect
- Open Settings
- Navigate to "Pianobar Config & Auth" tab
- Verify "Enable Profile Credentials..." is checked
- Uncheck "Kill process" checkbox
- Click Save
- Click Connect
- Verify:
- Pianobar starts successfully
- Click Disconnect
- Verify:
- Status shows "Disconnected from Pianobar (process detached)"
- Pianobar process is still running in Task Manager
- Music continues playing
Test 5: Disable Override (Gating)
- Open Settings
- Navigate to "Pianobar Config & Auth" tab
- Uncheck "Enable Profile Credentials and Custom Config Generation"
- Verify:
- "Kill process" checkbox becomes disabled (grayed out)
- All credential fields become disabled
- Cannot check "Kill process"
- Try to check "Kill process" (should not be possible)
- Click Save
- Close Settings
Test 6: Output Folder Browse Button
- Open Settings
- Navigate to "Outputs" tab
- Click the Browse button next to the output folder text box (ID:
output_folder_browse_button) - Verify:
- SaveFileDialog opens with title "Select Text File Output Path"
- Default filename is "now_playing.txt"
- Can select a location
- Select a location and click OK
- Verify:
- Selected path appears in the output folder text box
- Click Save
- Verify:
- Output path is saved to the profile
Edge Case Tests
Edge 1: Switch Profiles with Different Settings
- Create two profiles:
- Profile A: Kill process enabled
- Profile B: Kill process disabled
- Switch to Profile A and connect
- Disconnect ? Should kill the process
- Switch to Profile B and connect
- Disconnect ? Should detach (not kill)
Edge 2: Override Disabled Mid-Session
- Have Kill process enabled
- Open Settings while connected
- Uncheck "Enable Profile Credentials..."
- Verify "Kill process" becomes disabled
- Click Save
- Disconnect
- Verify process is detached (not killed), since override was disabled
Edge 3: No Active Profile
- Delete all profiles or ensure no profile is active
- Try to connect
- Verify:
- Error message: "No active profile selected..."
- Cannot connect without a profile
Expected Behavior Summary
| Override Enabled? | Kill Process Checked? | Disconnect Behavior |
|---|---|---|
| ? No | N/A (disabled) | Detach |
| ? Yes | ? No | Detach |
| ? Yes | ? Yes | Kill by PID |
Status Bar Messages
- Connect starting: "Starting Pianobar..."
- Connect success: "Connected to Pianobar (PID: XXXX)"
- Connect failed: "Failed to start Pianobar"
- Disconnect (kill): "Pianobar process killed (PID: XXXX)"
- Disconnect (detach): "Disconnected from Pianobar (process detached)"
Troubleshooting
Issue: Kill checkbox is always disabled
Solution: Make sure "Enable Profile Credentials and Custom Config Generation" is checked
Issue: Setting doesn't persist
Solution: Make sure you clicked Save before closing the Settings dialog
Issue: Process not killed on disconnect
Checks:
- Is "Enable Profile Credentials..." checked?
- Is "Kill process" checkbox checked?
- Did you save the profile?
- Is the correct profile active?
Issue: Cannot connect
Checks:
- Is a profile selected and active?
- Is the Pianobar executable path set correctly?
- Does the Pianobar.exe file exist at that path?
Files to Monitor
profiles.jsonin%APPDATA%\PianoBarHelper\- Check that
"KillProcessOnDisconnect": trueis saved for profiles where it's enabled
- Check that
- Task Manager ? Details
- Watch for
pianobar.exeprocess appearing/disappearing during connect/disconnect
- Watch for