https://github.com/gitpod-samples/playwright-local-server
Use your MacBook as the playwright server (local browsers) for running tests from Gitpod
https://github.com/gitpod-samples/playwright-local-server
Last synced: 4 months ago
JSON representation
Use your MacBook as the playwright server (local browsers) for running tests from Gitpod
- Host: GitHub
- URL: https://github.com/gitpod-samples/playwright-local-server
- Owner: gitpod-samples
- Created: 2024-10-22T15:22:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-30T17:00:12.000Z (over 1 year ago)
- Last Synced: 2025-03-18T06:14:09.859Z (11 months ago)
- Language: Shell
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gitpod auto playwright server forwarding
This launches a local playwright server on your MacBook and automatically sets up reverse port forwarding so that the playwright server is accessible from all your Gitpod workspaces.
It monitors for newly created Gitpod workspaces using the `gitpod` CLI in the background.
# Prerequisites
Open a terminal on your MacBook and run following commands. This will install nodejs (if missing) and Gitpod CLI. Homebrew is necessary.
```bash
brew install gitpod-io/tap/gitpod bash
! which npm && brew install node
gitpod login --host gitpod.io
```
After you're logged in to Gitpod. Run this final command:
```bash
curl --proto '=https' --tlsv1.2 -sSfL "https://raw.githubusercontent.com/gitpod-samples/playwright-local-server/35875ec/gitpod-autopwf" | /opt/homebrew/bin/bash -s selfinstall
```
# Setup
Add the following line to your gitpod Dockerfile and push to your repository:
```dockerfile
ENV PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:9999
```
This only needs to be done once and by someone who maintains the Gitpod configuration files.
Now all your newly created Gitpod workspaces should use the local playwright server running on your MacBook for `playwright test` commands.