Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit 17cb5cf

Browse files
authored
fix: playwright setup on Gitpod (#2261)
* fix playwright setup on gitpod * use custom dockerfile * use correct image * add sudo & latest tag * remove sudo * only install deps in dockerfile * use npx * remove apt update * change installs in dockerfile * fix npm typo * install chromium in gitpod yml * use npx for playwright * put playwright install in command section * use playwright install-deps * remove apt * install chromium in node modules folder * set playwright browsers path env var * update terminal env vars
1 parent 1274cb5 commit 17cb5cf

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

.gitpod.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM gitpod/workspace-mongodb:latest
2+
RUN npx playwright install-deps chromium

.gitpod.dockerfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitpod.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
---
22
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
33
tasks:
4-
- name: Install npm depdencies
5-
init: npm i
4+
- name: Install npm dependencies
5+
init: |
6+
npm ci
7+
PLAYWRIGHT_BROWSERS_PATH=0 npx playwright install chromium
68
command: |
9+
gp env PLAYWRIGHT_BROWSERS_PATH=0
10+
eval $(gp env -e)
711
gp ports await 27017
812
npm run dev
913
- name: Mongo
@@ -20,7 +24,8 @@ github:
2024
addComment: false
2125
addBadge: true
2226

23-
image: gitpod/workspace-mongodb
27+
image:
28+
file: .gitpod.Dockerfile
2429

2530
vscode:
2631
extensions:

playwright.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ const config = {
3434
forbidOnly: !!process.env.CI,
3535
/* Retry on CI only */
3636
retries: process.env.CI ? 2 : 0,
37-
/* Opt out of parallel tests on CI. */
38-
workers: process.env.CI ? 1 : undefined,
37+
/* Opt out of parallel tests on CI & Gitpod. */
38+
workers: process.env.CI || process.env.GITPOD_MEMORY ? 1 : undefined,
3939
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
4040
reporter: "html",
4141
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

0 commit comments

Comments
 (0)