mirror of
https://github.com/m1ngsama/TUT.git
synced 2026-02-08 09:04:04 +00:00
- Add test_browser.sh interactive testing script - Add TESTING.md comprehensive testing guide - Update help text with form interaction details - Include keyboard shortcuts for text input and dropdowns - Add instructions for all new features Improvements: - Help now shows 'i' key for form focus - Text input editing instructions - Dropdown selection navigation guide - Testing checklist for all features - Interactive test script for easy website testing
4.1 KiB
4.1 KiB
TUT Browser Testing Guide
This document provides comprehensive testing instructions to ensure the browser works correctly.
Quick Start
# Build the browser
cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug
cmake --build build
# Run with a test site
./build/tut http://example.com
# Or use the interactive test script
./test_browser.sh
Feature Testing Checklist
Basic Navigation
- Browser loads and displays page correctly
- Scroll with j/k works smoothly
- Page up/down (Ctrl+d/u) works
- Go to top (gg) and bottom (G) works
- Back (h) and forward (l) navigation works
Link Navigation
- Tab cycles through links
- Shift+Tab goes to previous link
- Enter follows the active link
- Links are highlighted when active
- Link URLs shown in status bar
Search
- Press / to enter search mode
- Type search term and press Enter
- Matches are highlighted
- n/N navigate between matches
- Search count shown in status bar
Form Interaction
- Press 'i' to focus first form field
- Tab/Shift+Tab navigate between fields
- Enter on text input enters edit mode
- Text can be typed and edited
- Backspace removes characters
- Enter or Esc exits edit mode
- Checkbox toggles with Enter
- SELECT dropdown shows options
- j/k navigate dropdown options
- Enter selects option in dropdown
- Selected option displays correctly
Bookmarks
- Press B to bookmark current page
- Press D to remove bookmark
- Type :bookmarks to view all bookmarks
- Bookmarks persist between sessions
- Can click bookmarks to open pages
History
- Type :history to view browsing history
- History shows URLs and titles
- History entries are clickable
- History persists between sessions
- Recent pages appear at top
Performance
- Page loads are async with spinner
- Esc cancels page loading
- Page cache works (revisit loads instantly)
- Image cache works (images load from cache)
- Status shows "cached: N" for cached images
- Scrolling is smooth
- No noticeable lag in UI
Commands
- :o URL opens new URL
- :q quits the browser
- :bookmarks shows bookmarks
- :history shows history
- :help shows help page
- ? also shows help page
Edge Cases
- Window resize updates layout correctly
- Very long pages scroll correctly
- Pages without links/forms work
- Unicode text displays correctly
- CJK characters display correctly
- Images render as ASCII art (if stb_image available)
- Error handling for failed page loads
Test Websites
Simple Test Sites
- http://example.com - Basic HTML test
- http://info.cern.ch - First website ever, very simple
- http://motherfuckingwebsite.com - Minimalist design
- http://textfiles.com - Text-only content
Form Testing
Create a local test file (test_form.html is provided):
python3 -m http.server 8000
./build/tut http://localhost:8000/test_form.html
Test the form features:
- Text input editing
- Checkbox toggling
- Dropdown selection
- Tab navigation
Performance Testing
- Load a page
- Press 'r' to refresh (should use cache)
- Load the same page again (should be instant from cache)
- Check status bar shows "cached" messages
Known Limitations
- HTTPS support depends on libcurl configuration
- Some complex JavaScript-heavy sites won't work (static HTML only)
- File:// URLs may not work depending on curl configuration
- Form submission is not yet implemented
- Cookies are not yet supported
Reporting Issues
When reporting issues, please include:
- The URL you were trying to load
- The exact steps to reproduce
- Expected vs actual behavior
- Any error messages
Success Criteria
The browser is working correctly if:
- ✓ Can load and display simple HTML pages
- ✓ Navigation (scroll, links) works smoothly
- ✓ Form interaction is responsive and intuitive
- ✓ Bookmarks and history persist correctly
- ✓ Caching improves performance noticeably
- ✓ No crashes or hangs during normal use