This directory contains the create-scenario.js script for scaffolding new test scenarios in the example app.
From the root of the project:
node scripts/create-scenario.js --name "Your Scenario Name" --category basic --id your-scenario-id--name- Human-readable scenario name (e.g., "Pinch Zoom Enabled")--category- Scenario category:basic,navigation, orzoom--id- Unique scenario ID in kebab-case (optional, auto-generated from name)
If you don't provide all arguments, the script will prompt you interactively:
node scripts/create-scenario.js
# Scenario name (e.g., 'Pinch Zoom Enabled'): My Scenario
# Category (basic/navigation/zoom): basic
# Scenario ID [my-scenario]:For a scenario named "Pinch Zoom Enabled" in the "zoom" category:
example/screens/scenarios/zoom/PinchZoomEnabled.ts- Scenario metadataexample/screens/scenarios/zoom/PinchZoomEnabledCoolPdfScreen.tsx- CoolPDF implementationexample/screens/scenarios/zoom/PinchZoomEnabledReactNativePdfScreen.tsx- react-native-pdf implementation
example/screens/scenarios/index.ts- Adds imports, exports, and registry entryexample/App.tsx- Adds screen imports, navigation types, and routes
The script creates template files with TODO comments. Next steps:
- Edit the scenario metadata (description, expectedBehavior, etc.)
- Add PDF props to the CoolPDF screen
- Add PDF props to the react-native-pdf screen
- Test both implementations
node scripts/create-scenario.js --name "Enable Pinch Zoom" --category zoom --id enable-pinch-zoomThis creates:
PinchZoomEnabled.tsPinchZoomEnabledCoolPdfScreen.tsxPinchZoomEnabledReactNativePdfScreen.tsx
And automatically wires them into the navigation system.