-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ECO-4787: Use interception proxy prototype
This adds a client for the interception proxy, and passes all test WebSocket traffic through the proxy. It does not currently perform any modifications to the WebSocket traffic (I’ll add a subsequent commit where we convert a handful of tests to use the proxy instead of private APIs for intercepting and modifying Realtime protocol messages). This is very much a prototype and work in progress, hence all the TODOs. The API of InterceptionProxyClient will probably evolve as we convert more tests to use it. I’ve also added an NPM script called test:playwright:open-browser script, which lets you open a headed browser which is configured to use the interception proxy. Useful for local debugging of browser tests. Here’s how to run the tests locally on macOS: One-time setup: 1. Install the interception proxy’s Python dependencies (see readme of [1]) 2. Run `npm install` to install the interception proxy 3. Generate mitmproxy TLS certificate: `npx --package interception-proxy generate-mitmproxy-certs` Running the tests: 1. In a separate terminal, run the interception proxy (after each test run, you’ll need to kill this and run it again, which is a bit annoying; it would be good to fix this): `npx interception-proxy` 2. Run the tests: - Node: `NODE_EXTRA_CA_CERTS=~/.mitmproxy/mitmproxy-ca-cert.pem npm run test:node` - Browser: The easiest one is Firefox since it doesn’t require you to install any CA certificates: `PLAYWRIGHT_BROWSER=firefox npm run test:playwright` [1] https://github.com/ably-labs/interception-proxy
- Loading branch information
1 parent
3ce7032
commit 63ecb49
Showing
15 changed files
with
590 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.