test: improve action test reliability (#80587)
## Summary
This PR improves test reliability for the app-dir actions test suite by
addressing race conditions and modernizing file system operations.
## Changes
### Test Improvements
- **Fixed race conditions** in revalidation tests by ensuring proper
sequencing of assertions
- URL assertions now occur before DOM checks to prevent flaky failures
- Added explicit waits and retries for revalidated content
- Improved test flow with proper page transition checks
### Code Modernization
- **Updated file system operations** to use modern Node.js APIs
- Migrated from `fs-extra` to native `node:fs/promises`
- Replaced sync operations with async equivalents for better performance
- Updated import paths to use `node:` protocol for built-in modules
### Specific Fixes
- Fixed timing issues in the revalidate path/tag tests where assertions
were checking values before revalidation completed
- Added proper waiting for deploy environments where revalidation may
have eventual consistency
- Improved cookie handling by reading the value once to avoid potential
race conditions
- Added semantic `id="title"` to help with page transition assertions