Run Cypress interactive UI in Docker (#9954)

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
GitOrigin-RevId: 51e7149cf10475c229d6e7a9ae8cf5694002d27b
This commit is contained in:
Alf Eaton 2022-10-31 09:37:25 +00:00 committed by Copybot
parent 1bee2cfba3
commit 0e09c25a97
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,12 @@
services:
cypress:
image: cypress/included:10.9.0
volumes:
- ../../:/overleaf
- /tmp/.X11-unix:/tmp/.X11-unix
working_dir: /overleaf/services/web
entrypoint: npm
user: "${DOCKER_USER:-1000:1000}"
environment:
- "DISPLAY=${DISPLAY:-:0}"
# - "DEBUG=cypress.*"

View file

@ -34,6 +34,8 @@
"convert-themes": "node modules/source-editor/frontend/js/themes/convert.js", "convert-themes": "node modules/source-editor/frontend/js/themes/convert.js",
"cypress:open-ct": "SHARELATEX_CONFIG=$PWD/config/settings.webpack.js cypress open --component", "cypress:open-ct": "SHARELATEX_CONFIG=$PWD/config/settings.webpack.js cypress open --component",
"cypress:run-ct": "SHARELATEX_CONFIG=$PWD/config/settings.webpack.js cypress run --component", "cypress:run-ct": "SHARELATEX_CONFIG=$PWD/config/settings.webpack.js cypress run --component",
"cypress:docker:open-ct": "DOCKER_USER=\"$(id -u):$(id -g)\" docker-compose -f docker-compose.cypress.yml run --rm cypress run cypress:open-ct",
"cypress:docker:run-ct": "DOCKER_USER=\"$(id -u):$(id -g)\" docker-compose -f docker-compose.cypress.yml run --rm cypress run cypress:run-ct",
"lezer-latex:generate": "if [ ! -d $(pwd)/modules/source-editor ]; then echo \"'source-editor' module is not available\"; exit 0; fi; node modules/source-editor/scripts/lezer-latex/generate.js", "lezer-latex:generate": "if [ ! -d $(pwd)/modules/source-editor ]; then echo \"'source-editor' module is not available\"; exit 0; fi; node modules/source-editor/scripts/lezer-latex/generate.js",
"lezer-latex:run": "node modules/source-editor/scripts/lezer-latex/run.mjs", "lezer-latex:run": "node modules/source-editor/scripts/lezer-latex/run.mjs",
"lezer-latex:benchmark": "node modules/source-editor/scripts/lezer-latex/benchmark.mjs", "lezer-latex:benchmark": "node modules/source-editor/scripts/lezer-latex/benchmark.mjs",