Skip to content

Commit

Permalink
πŸ“Έ e2e: Rename golden snapshots for docker platform (#400)
Browse files Browse the repository at this point in the history
Rename golden snapshots for docker platform from `linux` to `docker`. This is so
that linux devs 🐣🐧 can have different local Linux snapshots to what is
generated via the playwright jammy docker image. In my case they seem to be
different because I have locally the Fira Code font pre-installed. I have tried
waiting for fonts to be loaded without luck πŸ€·β€β™‚.

Pull-request: #400
  • Loading branch information
juliaogris authored Aug 1, 2024
1 parent 1c79064 commit d7cd5bb
Show file tree
Hide file tree
Showing 42 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.hermit/
/e2e/test-results
/e2e/**/*-darwin.png
/e2e/**/*-linux.png
/firebase/*.log
/firebase/.firebase/
/frontend/module/evy.wasm
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,12 @@ endef
PLAYWRIGHT_OCI_IMAGE = mcr.microsoft.com/playwright:v1.44.1-jammy
PLAYWRIGHT_CMD_DOCKER = docker run --rm \
--volume $$(pwd):/work/ -w /work/ \
--user $(shell id -u):$(shell id -g) \
--network host --add-host=host.docker.internal:host-gateway \
--env BASEURL=$(BASEURL) \
--env NPM_CONFIG_UPDATE_NOTIFIER=false \
--env PLATFORM_OVERRIDE=docker \
--env HOME=/tmp \
$(PLAYWRIGHT_OCI_IMAGE) /bin/bash -e -c "$(subst $(nl),;,$(PLAYWRIGHT_CMD_LOCAL))"

PLAYWRIGHT_CMD = $(PLAYWRIGHT_CMD_$(if $(USE_DOCKER),DOCKER,LOCAL))
Expand Down
3 changes: 3 additions & 0 deletions e2e/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { defineConfig, devices } from "@playwright/test"

const platform = process.env.PLATFORM_OVERRIDE || process.platform
export default defineConfig({
use: {
baseURL: process.env.BASEURL || "http://localhost:8080",
Expand All @@ -14,4 +16,5 @@ export default defineConfig({
},
],
testMatch: "*test.js",
snapshotPathTemplate: `{testDir}/{testFilePath}-snapshots/{arg}-{projectName}-${platform}{ext}`,
})

0 comments on commit d7cd5bb

Please sign in to comment.