fix(cypress): persist globalState to file for parallel execution
Root cause: globalState was stored in-memory and lost when setup
Cypress process exited. Parallel batch processes started with empty
globalState, causing all tests to fail with undefined merchant/API keys.
Solution:
- Modified cypress.config.js to persist globalState to a JSON file
- Each connector gets its own file: cypress/globalState_{connectorId}.json
- Setup tests write state to file after execution
- Batch tests read state from file before execution
- Added globalState_*.json to .gitignore
This enables true parallelization while maintaining state continuity
across separate Cypress processes.
Benefits for local development:
- Can run individual batches after setup without re-running all tests
- State survives Cypress crashes
- Can inspect/debug state via JSON file
- Better isolation between connectors
Technical details:
- setGlobalState now uses fs.writeFileSync to persist state
- getGlobalState reads from file if it exists, returns {} otherwise
- File path includes connectorId for isolation between connectors
- Error handling added for file I/O failures