Purpose: Tests login functionality only Test Cases:
test_invalid_login()- Tests invalid credentials rejectiontest_successful_login()- Tests successful login and dashboard redirect
Features:
- ✅ Browser initialization and cleanup
- ✅ Login validation
- ✅ Clear test reporting
- ✅ Can be run independently
Usage: python login_test_case.py
Purpose: Tests dashboard "All Time Figures" sections Test Cases:
test_all_time_figures_sections()- Validates all 4 dashboard sections have data
Features:
- ✅ Auto-login check (logs in if needed)
- ✅ Finds sections by width (30%, 22%, 22%, 13%)
- ✅ Validates labels and values in each section
- ✅ Comprehensive reporting of found/missing sections
- ✅ Screenshot on error
- ✅ Can be run independently
Usage: python dashboard_test_case.py
Purpose: Orchestrates both test suites Options:
- Run ALL tests (Login → Dashboard)
- Run LOGIN tests only
- Run DASHBOARD tests only
- Exit
Features:
- ✅ Sequential execution (Login first, then Dashboard)
- ✅ Comprehensive reporting across both test suites
- ✅ User-friendly menu interface
- ✅ Combined success/failure reporting
Usage: python main.py
-
Phase 1: Login Tests
- Invalid login test (standalone)
- Valid login test (establishes session)
-
Phase 2: Dashboard Tests
- Checks if already logged in
- Logs in if needed
- Tests all 4 "All Time Figures" sections
- Validates each section has label and value
- Test Case 1 (Login): ✅ SUCCESS if login works
- Test Case 2 (Dashboard): ✅ SUCCESS if all 4 sections found with data
- Separation of Concerns: Login and Dashboard tests are now separate
- Reusable Components: Each test file can run independently
- Better Error Handling: More detailed error reporting and debugging
- Session Management: Dashboard tests auto-login if needed
- User Experience: Clear menu and comprehensive reporting
- Debugging: Screenshots saved on dashboard test failures
python main.py
# Select option 1 or just press Enterpython login_test_case.py
# OR
python main.py
# Select option 2python dashboard_test_case.py
# OR
python main.py
# Select option 3login_test_case_old.py- Original login test filedashboard_test_case_old.py- Original dashboard test file
The new structure provides better modularity, clearer test separation, and improved user experience while maintaining all the original functionality.