Skip to content

Commit

Permalink
Merge pull request #218 from PainterQubits/#203-switch-to-playwright-…
Browse files Browse the repository at this point in the history
…for-e2e-tests

#203 Switch to Playwright for E2E tests
  • Loading branch information
alexhad6 authored Jan 3, 2024
2 parents 32589eb + e08fbfa commit 6366f63
Show file tree
Hide file tree
Showing 44 changed files with 2,014 additions and 3,212 deletions.
13 changes: 1 addition & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:jest/recommended",
"prettier"
],
"rules": {
Expand All @@ -21,17 +22,5 @@
"version": "detect"
}
},
"overrides": [
{
"files": "src/**/*.test.{ts,tsx}",
"extends": ["plugin:jest/recommended"],
"plugins": ["jest"]
},
{
"files": "cypress/**/*.ts",
"extends": ["plugin:cypress/recommended"],
"plugins": ["cypress"]
}
],
"ignorePatterns": ["paramview/static/"]
}
48 changes: 9 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
run: poetry run mypy ${{ env.PACKAGE_NAME }} tests

- name: Test (Pytest)
run: poetry run pytest
run: poetry run pytest tests/unit

frontend:
runs-on: ubuntu-latest
Expand All @@ -71,29 +71,14 @@ jobs:
- name: Enable Yarn
run: corepack enable

- name: Get Cypress version
id: cypress-version
run: echo VERSION=$(yarn info cypress --json | jq ".children.Version" -r) >> $GITHUB_OUTPUT

- name: Cypress cache
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ steps.cypress-version.outputs.VERSION }}
restore-keys: |
cypress-${{ runner.os }}-
- name: Install Node.js dependencies
run: yarn

- name: Prune Cypress cache
run: yarn cypress cache prune

- name: Lint
run: yarn lint

- name: Unit tests
run: yarn test:unit
run: yarn test

e2e:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -122,39 +107,24 @@ jobs:
- name: Enable Yarn
run: corepack enable

- name: Get Cypress version
id: cypress-version
run: echo VERSION=$(yarn info cypress --json | jq ".children.Version" -r) >> $GITHUB_OUTPUT

- name: Cypress cache
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ steps.cypress-version.outputs.VERSION }}
restore-keys: |
cypress-${{ runner.os }}-
- name: Install Node.js dependencies
run: yarn

- name: Prune Cypress cache
run: yarn cypress cache prune
- name: Install Playwright browsers
run: poetry run playwright install --with-deps chromium

- name: Build frontend
run: yarn build

- name: Start backend server
run: yarn backend start &

- name: Start frontend server
run: yarn preview &
- name: Start E2E server
run: poetry run python tests/e2e/start_server.py &

- name: E2E tests
run: yarn test:e2e
run: poetry run pytest tests/e2e

- name: Upload failure screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: e2e-failure-screenshots
path: cypress/screenshots
name: e2e-failed-traces
path: test-results
15 changes: 0 additions & 15 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,9 @@ jobs:
- name: Enable Yarn
run: corepack enable

- name: Get Cypress version
id: cypress-version
run: echo VERSION=$(yarn info cypress --json | jq ".children.Version" -r) >> $GITHUB_OUTPUT

- name: Cypress cache
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ steps.cypress-version.outputs.VERSION }}
restore-keys: |
cypress-${{ runner.os }}-
- name: Install Node.js dependencies
run: yarn

- name: Prune Cypress cache
run: yarn cypress cache prune

- name: Build frontend
run: yarn build

Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ node_modules/
# Jest
coverage/

# Cypress
cypress/videos/
cypress/screenshots/
# Playwright
test-results/

# Data files
*.db
Expand Down
26 changes: 0 additions & 26 deletions cypress.config.mjs

This file was deleted.

139 changes: 0 additions & 139 deletions cypress/backend.py

This file was deleted.

Loading

0 comments on commit 6366f63

Please sign in to comment.