diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad3a6d64ea1db9d131c4b0fce9b5f5393a9d936f..3607cfff3fa243871253876132893e2f68ef8dff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,3 +25,32 @@ lint-openapi: stage: test script: openapi lint portal/static/docs/api/v0/openapi-spec.yaml allow_failure: true + +test-frontend: + image: python + stage: test + before_script: + - apt-get update + - apt-get install -y ca-certificates curl gnupg faketime + - mkdir -p /etc/apt/keyrings + - curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list + - apt-get update + - apt-get install -y nodejs libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb + - pip install --upgrade pip setuptools + - pip install pipenv + - pipenv requirements > requirements.txt + - pip uninstall --yes pipenv + - pip install -r requirements.txt + - npm install cypress + script: + - mkdir instance + - export FLASK_APP=portal + - faketime '2024-09-26 13:37:00' flask run & + - faketime '2024-09-26 13:37:00' npx cypress run + artifacts: + when: always + paths: + - cypress/videos + - cypress/screenshots + expire_in: 1 week