wip: Improve deep link validation and error handling

- Add comprehensive route validation with zod schema
- Create type-safe DeepLinkRoute enum for all valid routes
- Add structured error handling for invalid routes
- Redirect to error page with detailed feedback
- Add better timeout handling in deeplink tests

The changes improve robustness by:
1. Validating route paths before navigation
2. Providing detailed error messages for invalid links
3. Redirecting users to dedicated error pages
4. Adding parameter validation with specific feedback
5. Improving type safety across deeplink handling
This commit is contained in:
Matthew Raymer
2025-03-18 09:19:35 +00:00
parent 60ab6ad0c8
commit 26b98d8b0a
7 changed files with 173 additions and 21 deletions

View File

@@ -122,8 +122,15 @@ const executeDeeplink = async (url, description, log) => {
execSync(`adb shell am start -W -a android.intent.action.VIEW -d "${url}" -c android.intent.category.BROWSABLE`);
log(`✅ Successfully executed: ${description}`);
// Wait between deeplink tests
await new Promise(resolve => setTimeout(resolve, 5000)); // Wait 5s
// Wait for app to load content
await new Promise(resolve => setTimeout(resolve, 3000));
// Press a key (Back button) to ensure app is in consistent state
log(`📱 Sending keystroke (BACK) to device...`);
execSync('adb shell input keyevent KEYCODE_BACK');
// Wait a bit longer after keystroke before next test
await new Promise(resolve => setTimeout(resolve, 2000));
} catch (error) {
log(`❌ Failed to execute deeplink: ${description}`);
log(`Error: ${error.message}`);