This directory contains Playwright tests for the Share application, testing both web-to-web and web-to-CLI file transfers.
-
Build the Share binary:
cd /path/to/e2ecp cd web && npm install make build
-
Install Playwright dependencies:
npm install
-
Install Playwright browsers:
The Playwright browsers need to be installed before running tests. Try one of these methods:
Method A - Direct install (recommended for local development):
npx playwright install chromium
Method B - With system dependencies (if Method A fails):
npx playwright install --with-deps chromium
Method C - System browser (fallback): If the download fails due to network restrictions, you can configure Playwright to use system-installed Chromium/Chrome. See the Playwright documentation for details.
Note: In CI/CD environments, you may need to use the Playwright GitHub Action which handles browser installation automatically.
The easiest way to run tests is using the helper script:
cd tests
./run-tests.shThis script will:
- Check if the e2ecp binary exists (and build it if needed)
- Install test dependencies
- Install Playwright browsers if needed
- Run all Playwright tests
- Show results and test report location
npm run test:e2e./run-tests.sh --headed
# Or manually:
npm run test:e2e:headed./run-tests.sh --debug
# Or manually:
npm run test:e2e:debugnpm run test:reportnpx playwright test tests/web-to-web.spec.js
npx playwright test tests/web-to-cli.spec.jsTests file transfer between two browser clients:
- Starts a local relay server
- Opens two browser contexts (sender and receiver)
- Transfers a test file from sender to receiver
- Verifies the file content matches
Tests file transfer between web client and CLI:
- Web to CLI: Uploads file from browser, receives with CLI tool
- CLI to Web: Sends file with CLI tool, downloads in browser
- Verifies file integrity in both directions
- Each test suite starts its own relay server on a random port to avoid conflicts
- Tests use unique room names to prevent interference
- Server processes are properly cleaned up after tests complete
- Test files are created and deleted automatically
If you get an error about browsers not being installed:
npx playwright install chromiumTests use random ports (8080+ range) to avoid conflicts. If you still have issues, ensure no other services are using these ports.
Make sure the e2ecp binary exists in the root directory:
ls -la ../e2ecpIf it doesn't exist, build it:
cd .. && make build