Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Nov 19, 2023
1 parent 39370b9 commit 5d4d095
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
name: cypress tests
name: Cypress UI tests

on:
push:
branches-ignore:
- 'release-please-**'

jobs:
cypress-run:
concurrency: cypress-${{ github.head_ref || github.ref }}
runs-on: ubuntu-latest
steps:
- name: checkout
- name: Checkout
uses: actions/checkout@v4

- name: Yarn Install and Cache
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1
with:
cypress: true

- name: cypress run

- name: Build App
run: yarn build:test
shell: bash
env:
VITE_PORT: 3000
VITE_API_HOST: http://localhost:3636
VITE_GRAASP_APP_KEY: id-1234567890
VITE_MOCK_API: true
VITE_VERSION: cypress-tests

- name: Cypress Run
uses: cypress-io/github-action@v5
env:
VITE_PORT: 3000
Expand All @@ -28,22 +37,13 @@ jobs:
VITE_VERSION: cypress-tests
with:
install: false
build: yarn build
config: baseUrl=http://localhost:3000
start: yarn dev
start: yarn preview:test
browser: chrome
quiet: true
# point to new cypress@10 config file
config-file: cypress.config.ts

# - name: Run Component tests 🧪
# uses: cypress-io/github-action@v5
# with:
# # we have already installed everything
# install: false
# # to run component tests we need to use "component: true"
# component: true

- uses: actions/upload-artifact@v3
if: failure()
with:
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"start": "yarn dev",
"start:test": "yarn vite --mode test",
"build": "yarn vite build",
"build:test": "yarn vite build --mode test",
"preview": "yarn vite preview",
"preview:test": "yarn vite preview --mode test",
"postinstall": "husky install",
"lint": "eslint .",
"prettier:write": "prettier {src,cypress}/**/*.{ts,tsx,js,jsx} --write",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"noEmit": true,
"jsx": "react-jsx",
"typeRoots": ["node_modules", "node_modules/@types", "./src/@types"],
"types": ["vite/client", "cypress"],
"types": ["vite/client", "cypress", "node"],
"baseUrl": "./src",
"paths": {
"@/*": ["./*"]
Expand Down

0 comments on commit 5d4d095

Please sign in to comment.