mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
Upgrade Cypress (#245)
This commit is contained in:
45
.github/workflows/ci.yml
vendored
45
.github/workflows/ci.yml
vendored
@@ -66,7 +66,7 @@ jobs:
|
||||
- run: |
|
||||
mkdir -p ui/dist/img
|
||||
touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
|
||||
- run: docker-compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach
|
||||
- run: docker compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach
|
||||
working-directory: dev
|
||||
- name: Install ArangoDB
|
||||
run: |
|
||||
@@ -94,10 +94,10 @@ jobs:
|
||||
- run: gocap check ./cmd/catalyst
|
||||
|
||||
cypress:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
auth: [ simple, keycloak ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -111,34 +111,33 @@ jobs:
|
||||
yarn install
|
||||
yarn serve &
|
||||
working-directory: ui
|
||||
- run: go install github.com/cugu/wait_for_response@latest
|
||||
- name: Wait for frontend
|
||||
uses: cugu/wait_for_response@v1.12.0
|
||||
uses: cugu/wait_for_response@v1.13.0
|
||||
with:
|
||||
url: 'http://localhost:8080'
|
||||
responseCode: 200
|
||||
|
||||
# run containers
|
||||
- run: sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf
|
||||
shell: bash
|
||||
- run: sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx-with-keycloak.conf
|
||||
shell: bash
|
||||
- run: docker-compose up --quiet-pull --detach
|
||||
- run: |
|
||||
sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf
|
||||
sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx-with-keycloak.conf
|
||||
|
||||
- run: docker compose up --quiet-pull --detach
|
||||
working-directory: dev
|
||||
shell: bash
|
||||
if: ${{ matrix.auth == 'simple' }}
|
||||
- run: docker-compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach
|
||||
if: matrix.auth == 'simple'
|
||||
- run: docker compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach
|
||||
working-directory: dev
|
||||
shell: bash
|
||||
if: ${{ matrix.auth == 'keycloak' }}
|
||||
if: matrix.auth == 'keycloak'
|
||||
- name: Wait for keycloak
|
||||
uses: cugu/wait_for_response@v1.12.0
|
||||
uses: cugu/wait_for_response@v1.13.0
|
||||
with:
|
||||
url: 'http://localhost:9002/auth/realms/catalyst'
|
||||
responseCode: 200
|
||||
verbose: true
|
||||
timeout: 3m
|
||||
interval: 10s
|
||||
if: ${{ matrix.auth == 'keycloak' }}
|
||||
if: matrix.auth == 'keycloak'
|
||||
|
||||
# run catalyst
|
||||
- run: |
|
||||
@@ -147,12 +146,12 @@ jobs:
|
||||
- run: go mod download
|
||||
- run: bash start_dev.sh &
|
||||
working-directory: dev
|
||||
if: ${{ matrix.auth == 'simple' }}
|
||||
if: matrix.auth == 'simple'
|
||||
- run: bash start_dev_with_keycloak.sh &
|
||||
working-directory: dev
|
||||
if: ${{ matrix.auth == 'keycloak' }}
|
||||
if: matrix.auth == 'keycloak'
|
||||
- name: Wait for catalyst
|
||||
uses: cugu/wait_for_response@v1.12.0
|
||||
uses: cugu/wait_for_response@v1.13.0
|
||||
with:
|
||||
url: 'http://localhost:8000'
|
||||
method: GET
|
||||
@@ -162,12 +161,14 @@ jobs:
|
||||
interval: 10s
|
||||
|
||||
# run cypress
|
||||
- run: ./node_modules/.bin/cypress run --spec "cypress/integration/catalyst.js"
|
||||
- uses: cypress-io/github-action@v4
|
||||
env:
|
||||
CYPRESS_AUTH: ${{ matrix.auth }}
|
||||
working-directory: ui
|
||||
|
||||
with:
|
||||
browser: chrome
|
||||
working-directory: ui
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always() && matrix.auth == 'simple'
|
||||
with:
|
||||
name: cypress-videos
|
||||
path: ui/cypress/videos
|
||||
@@ -225,7 +226,7 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Version
|
||||
if: ${{ github.ref != '' }}
|
||||
if: github.ref != ''
|
||||
run: |
|
||||
echo ${{ github.ref_name }}
|
||||
echo ${{ github.ref_name }} > VERSION
|
||||
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
networks: [ catalyst ]
|
||||
|
||||
arangodb:
|
||||
image: arangodb/arangodb:3.9.1
|
||||
image: arangodb/arangodb:3.8.1
|
||||
environment:
|
||||
ARANGO_ROOT_PASSWORD: foobar
|
||||
networks: [ catalyst ]
|
||||
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
networks: [ catalyst ]
|
||||
|
||||
arangodb:
|
||||
image: arangodb/arangodb:3.9.1
|
||||
image: arangodb/arangodb:3.8.1
|
||||
environment:
|
||||
ARANGO_ROOT_PASSWORD: foobar
|
||||
networks: [ catalyst ]
|
||||
|
||||
14
ui/cypress.config.ts
Normal file
14
ui/cypress.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { defineConfig } from 'cypress'
|
||||
|
||||
export default defineConfig({
|
||||
chromeWebSecurity: false,
|
||||
e2e: {
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
return require('./cypress/plugins/index.js')(on, config)
|
||||
},
|
||||
baseUrl: 'http://localhost',
|
||||
experimentalSessionAndOrigin: true,
|
||||
},
|
||||
})
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"baseUrl": "http://localhost",
|
||||
"chromeWebSecurity": false,
|
||||
"experimentalSessionAndOrigin": true
|
||||
}
|
||||
@@ -70,7 +70,7 @@
|
||||
"@vue/eslint-config-typescript": "10.0.0",
|
||||
"@vue/test-utils": "2.0.0",
|
||||
"babel-eslint": "10.1.0",
|
||||
"cypress": "9.7.0",
|
||||
"cypress": "10.1.0",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-plugin-jest": "26.4.5",
|
||||
"eslint-plugin-vue": "7.20.0",
|
||||
|
||||
@@ -4701,10 +4701,10 @@ cyclist@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
|
||||
integrity "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A=="
|
||||
|
||||
cypress@9.7.0:
|
||||
version "9.7.0"
|
||||
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.7.0.tgz#bf55b2afd481f7a113ef5604aa8b693564b5e744"
|
||||
integrity sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q==
|
||||
cypress@10.1.0:
|
||||
version "10.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.1.0.tgz#6514a26c721822a02bc194e9a7f72c3142aea174"
|
||||
integrity sha512-aQ4JVZVib4Xd9FZW8IRZfKelUvqF4y5A+oUbNvn8TlsBmEfIg3m5Xd6Mt6PVU/jHiVJ9Psl905B3ZPnrDcmyuQ==
|
||||
dependencies:
|
||||
"@cypress/request" "^2.88.10"
|
||||
"@cypress/xvfb" "^1.2.4"
|
||||
|
||||
Reference in New Issue
Block a user