Upgrade Cypress (#245)

This commit is contained in:
Jonas Plum
2022-06-14 15:59:35 +02:00
committed by GitHub
parent 48459b8a8b
commit 7caf676571
9 changed files with 44 additions and 34 deletions

View File

@@ -66,7 +66,7 @@ jobs:
- run: | - run: |
mkdir -p ui/dist/img mkdir -p ui/dist/img
touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png 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 working-directory: dev
- name: Install ArangoDB - name: Install ArangoDB
run: | run: |
@@ -94,10 +94,10 @@ jobs:
- run: gocap check ./cmd/catalyst - run: gocap check ./cmd/catalyst
cypress: cypress:
runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
auth: [ simple, keycloak ] auth: [ simple, keycloak ]
runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -111,34 +111,33 @@ jobs:
yarn install yarn install
yarn serve & yarn serve &
working-directory: ui working-directory: ui
- run: go install github.com/cugu/wait_for_response@latest
- name: Wait for frontend - name: Wait for frontend
uses: cugu/wait_for_response@v1.12.0 uses: cugu/wait_for_response@v1.13.0
with: with:
url: 'http://localhost:8080' url: 'http://localhost:8080'
responseCode: 200 responseCode: 200
# run containers # run containers
- run: sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf - run: |
shell: bash sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf
- run: sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx-with-keycloak.conf 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: docker compose up --quiet-pull --detach
working-directory: dev working-directory: dev
shell: bash if: matrix.auth == 'simple'
if: ${{ matrix.auth == 'simple' }} - 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 working-directory: dev
shell: bash if: matrix.auth == 'keycloak'
if: ${{ matrix.auth == 'keycloak' }}
- name: Wait for keycloak - name: Wait for keycloak
uses: cugu/wait_for_response@v1.12.0 uses: cugu/wait_for_response@v1.13.0
with: with:
url: 'http://localhost:9002/auth/realms/catalyst' url: 'http://localhost:9002/auth/realms/catalyst'
responseCode: 200 responseCode: 200
verbose: true verbose: true
timeout: 3m timeout: 3m
interval: 10s interval: 10s
if: ${{ matrix.auth == 'keycloak' }} if: matrix.auth == 'keycloak'
# run catalyst # run catalyst
- run: | - run: |
@@ -147,12 +146,12 @@ jobs:
- run: go mod download - run: go mod download
- run: bash start_dev.sh & - run: bash start_dev.sh &
working-directory: dev working-directory: dev
if: ${{ matrix.auth == 'simple' }} if: matrix.auth == 'simple'
- run: bash start_dev_with_keycloak.sh & - run: bash start_dev_with_keycloak.sh &
working-directory: dev working-directory: dev
if: ${{ matrix.auth == 'keycloak' }} if: matrix.auth == 'keycloak'
- name: Wait for catalyst - name: Wait for catalyst
uses: cugu/wait_for_response@v1.12.0 uses: cugu/wait_for_response@v1.13.0
with: with:
url: 'http://localhost:8000' url: 'http://localhost:8000'
method: GET method: GET
@@ -162,12 +161,14 @@ jobs:
interval: 10s interval: 10s
# run cypress # run cypress
- run: ./node_modules/.bin/cypress run --spec "cypress/integration/catalyst.js" - uses: cypress-io/github-action@v4
env: env:
CYPRESS_AUTH: ${{ matrix.auth }} CYPRESS_AUTH: ${{ matrix.auth }}
working-directory: ui with:
browser: chrome
working-directory: ui
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: always() && matrix.auth == 'simple'
with: with:
name: cypress-videos name: cypress-videos
path: ui/cypress/videos path: ui/cypress/videos
@@ -225,7 +226,7 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Version - name: Version
if: ${{ github.ref != '' }} if: github.ref != ''
run: | run: |
echo ${{ github.ref_name }} echo ${{ github.ref_name }}
echo ${{ github.ref_name }} > VERSION echo ${{ github.ref_name }} > VERSION

View File

@@ -8,7 +8,7 @@ services:
networks: [ catalyst ] networks: [ catalyst ]
arangodb: arangodb:
image: arangodb/arangodb:3.9.1 image: arangodb/arangodb:3.8.1
environment: environment:
ARANGO_ROOT_PASSWORD: foobar ARANGO_ROOT_PASSWORD: foobar
networks: [ catalyst ] networks: [ catalyst ]

View File

@@ -8,7 +8,7 @@ services:
networks: [ catalyst ] networks: [ catalyst ]
arangodb: arangodb:
image: arangodb/arangodb:3.9.1 image: arangodb/arangodb:3.8.1
environment: environment:
ARANGO_ROOT_PASSWORD: foobar ARANGO_ROOT_PASSWORD: foobar
networks: [ catalyst ] networks: [ catalyst ]

14
ui/cypress.config.ts Normal file
View 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,
},
})

View File

@@ -1,5 +0,0 @@
{
"baseUrl": "http://localhost",
"chromeWebSecurity": false,
"experimentalSessionAndOrigin": true
}

View File

@@ -70,7 +70,7 @@
"@vue/eslint-config-typescript": "10.0.0", "@vue/eslint-config-typescript": "10.0.0",
"@vue/test-utils": "2.0.0", "@vue/test-utils": "2.0.0",
"babel-eslint": "10.1.0", "babel-eslint": "10.1.0",
"cypress": "9.7.0", "cypress": "10.1.0",
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-plugin-jest": "26.4.5", "eslint-plugin-jest": "26.4.5",
"eslint-plugin-vue": "7.20.0", "eslint-plugin-vue": "7.20.0",

View File

@@ -4701,10 +4701,10 @@ cyclist@^1.0.1:
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
integrity "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A==" integrity "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A=="
cypress@9.7.0: cypress@10.1.0:
version "9.7.0" version "10.1.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.7.0.tgz#bf55b2afd481f7a113ef5604aa8b693564b5e744" resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.1.0.tgz#6514a26c721822a02bc194e9a7f72c3142aea174"
integrity sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q== integrity sha512-aQ4JVZVib4Xd9FZW8IRZfKelUvqF4y5A+oUbNvn8TlsBmEfIg3m5Xd6Mt6PVU/jHiVJ9Psl905B3ZPnrDcmyuQ==
dependencies: dependencies:
"@cypress/request" "^2.88.10" "@cypress/request" "^2.88.10"
"@cypress/xvfb" "^1.2.4" "@cypress/xvfb" "^1.2.4"