e2e:
  image: cypress/browsers:latest # https://hub.docker.com/r/cypress/browsers/tags/
  stage: test
  script:
    - pnpm --filter=@openstapps/app install
    - pnpm --filter=@openstapps/app exec cypress install
    - pnpm test:integration:app
  artifacts:
    when: on_failure
    paths:
      - frontend/app/cypress/videos
      - frontend/app/cypress/screenshots
      - frontend/app/coverage/integration-report-junit.xml
    reports:
      junit:
        - frontend/app/coverage/integration-report-junit.xml
  parallel:
    matrix:
      - BROWSER: chrome
      - BROWSER: firefox
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
