|
| 1 | +# Phase 9 Testing Guide |
| 2 | + |
| 3 | +This guide covers testing the file operations and dialogs implemented in Phase 9. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- .NET 10 SDK installed |
| 8 | +- Go backend built (`make build` in project root) |
| 9 | +- macOS 26.2 (primary development platform) |
| 10 | + |
| 11 | +## Build & Run |
| 12 | + |
| 13 | +```bash |
| 14 | +cd avalonia-gui |
| 15 | + |
| 16 | +# Build |
| 17 | +dotnet build |
| 18 | + |
| 19 | +# Run application |
| 20 | +dotnet run --project ARMEmulator |
| 21 | + |
| 22 | +# Run tests |
| 23 | +dotnet test |
| 24 | +``` |
| 25 | + |
| 26 | +## Test Checklist |
| 27 | + |
| 28 | +### 1. File Menu Commands |
| 29 | + |
| 30 | +- [ ] **Open File (Ctrl+O)** |
| 31 | + - Click File > Open or press Ctrl+O |
| 32 | + - Select an assembly file (.s) |
| 33 | + - Verify file content loads in editor |
| 34 | + - Verify file is added to Recent Files |
| 35 | + |
| 36 | +- [ ] **Save File (Ctrl+S)** |
| 37 | + - Make changes to editor |
| 38 | + - Click File > Save or press Ctrl+S |
| 39 | + - Verify file is saved to current location |
| 40 | + - For new files, should show Save As dialog |
| 41 | + |
| 42 | +- [ ] **Save As (Ctrl+Shift+S)** |
| 43 | + - Click File > Save As or press Ctrl+Shift+S |
| 44 | + - Enter new filename |
| 45 | + - Verify file is saved to new location |
| 46 | + - Verify file is added to Recent Files |
| 47 | + |
| 48 | +- [ ] **Recent Files** |
| 49 | + - Open several files |
| 50 | + - Click File > Recent Files |
| 51 | + - Verify list shows recently opened files |
| 52 | + - Click a recent file to open it |
| 53 | + - Verify file loads correctly |
| 54 | + |
| 55 | +- [ ] **Examples Browser (Ctrl+Shift+E)** |
| 56 | + - Click File > Examples or press Ctrl+Shift+E |
| 57 | + - Search for examples (try "fib", "hello", etc.) |
| 58 | + - Verify search filters list |
| 59 | + - Select an example |
| 60 | + - Verify preview shows on right |
| 61 | + - Click Load |
| 62 | + - Verify example loads in editor |
| 63 | + |
| 64 | +- [ ] **Preferences (Ctrl+,)** |
| 65 | + - Click File > Preferences or press Ctrl+, |
| 66 | + - **General Tab:** |
| 67 | + - Modify Backend URL |
| 68 | + - Change Theme (Auto/Light/Dark) |
| 69 | + - Adjust Recent Files Limit |
| 70 | + - Toggle Auto-scroll memory writes |
| 71 | + - **Editor Tab:** |
| 72 | + - Adjust Font Size (10-24) |
| 73 | + - Verify live preview updates |
| 74 | + - Click OK |
| 75 | + - Verify settings are applied (font size should change) |
| 76 | + |
| 77 | +- [ ] **About Dialog** |
| 78 | + - Click File > About |
| 79 | + - Verify app version displays |
| 80 | + - Verify backend version loads (if backend is running) |
| 81 | + - If backend not running, should show "Not available" |
| 82 | + - Verify commit hash and build date appear |
| 83 | + - Click Close |
| 84 | + |
| 85 | +### 2. Keyboard Shortcuts |
| 86 | + |
| 87 | +Verify all keyboard shortcuts work: |
| 88 | +- Ctrl+O: Open |
| 89 | +- Ctrl+S: Save |
| 90 | +- Ctrl+Shift+S: Save As |
| 91 | +- Ctrl+Shift+E: Examples |
| 92 | +- Ctrl+,: Preferences |
| 93 | + |
| 94 | +### 3. Dialog Behavior |
| 95 | + |
| 96 | +- [ ] All dialogs center on parent window |
| 97 | +- [ ] Dialogs are modal (parent disabled while open) |
| 98 | +- [ ] Cancel closes without applying changes |
| 99 | +- [ ] OK/Load buttons apply changes |
| 100 | + |
| 101 | +### 4. File Service Integration |
| 102 | + |
| 103 | +- [ ] Opening file updates editor content |
| 104 | +- [ ] Opening file auto-loads program |
| 105 | +- [ ] Saving file preserves content |
| 106 | +- [ ] Recent files list updates correctly |
| 107 | +- [ ] Recent files persists across sessions (TODO: needs persistence implementation) |
| 108 | + |
| 109 | +### 5. Error Handling |
| 110 | + |
| 111 | +- [ ] Try opening non-existent file from Recent Files |
| 112 | + - Should show error message |
| 113 | + - Should not crash |
| 114 | +- [ ] Try opening invalid assembly file |
| 115 | + - Should load but show parse errors |
| 116 | +- [ ] Try examples with backend not running |
| 117 | + - Should show error in examples browser |
| 118 | + |
| 119 | +## Platform-Specific Testing |
| 120 | + |
| 121 | +### macOS |
| 122 | +- [ ] Native file dialogs appear |
| 123 | +- [ ] Menu bar integrates with system |
| 124 | +- [ ] Keyboard shortcuts follow macOS conventions |
| 125 | +- [ ] App bundle structure correct |
| 126 | + |
| 127 | +### Windows (if available) |
| 128 | +- [ ] Native file dialogs appear |
| 129 | +- [ ] Menu bar appears in window |
| 130 | +- [ ] Keyboard shortcuts work |
| 131 | +- [ ] .exe runs standalone |
| 132 | + |
| 133 | +### Linux (if available) |
| 134 | +- [ ] File dialogs work |
| 135 | +- [ ] Menu bar appears |
| 136 | +- [ ] Keyboard shortcuts work |
| 137 | + |
| 138 | +## Known Limitations |
| 139 | + |
| 140 | +1. **Settings Persistence**: Not yet implemented. Settings reset on restart. |
| 141 | +2. **Recent Files Persistence**: Not yet implemented. List clears on restart. |
| 142 | +3. **Theme Changes**: Require app restart to take effect. |
| 143 | + |
| 144 | +## Test Results |
| 145 | + |
| 146 | +All 223 unit tests passing: |
| 147 | +- AppSettings: 6 tests |
| 148 | +- FileService: 8 tests |
| 149 | +- AboutWindowViewModel: 5 tests |
| 150 | +- PreferencesWindowViewModel: 6 tests |
| 151 | +- ExamplesBrowserViewModel: 6 tests |
| 152 | +- MainWindowViewModel: 10 tests |
| 153 | +- Other ViewModels and Services: 182 tests |
| 154 | + |
| 155 | +Build status: ✅ Clean build with 0 warnings, 0 errors |
0 commit comments