mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Replace Cypress with Playwright
Playwright is more flexible and has better developer experience than Cypress.
We add end to end tests covering:
- project source browsing
- tree view
- commit list view
- commit view
- routing
- hash based
- history API based
- clipboard copy paste functionality
- seed view
- project search
- landing page view
- settings
Co-authored-by: Sebastian Martinez <me@sebastinez.dev>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
co-authored by
Sebastian Martinez
parent
d740d7e5a1
commit
9cb9332e88
@@ -3,19 +3,25 @@ on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
check-build:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '18.12.1'
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v4
|
||||
with:
|
||||
browser: chrome
|
||||
start: npm run serve
|
||||
wait-on: "http://localhost:4173"
|
||||
command: npx cypress run --config baseUrl="http://localhost:4173" --spec 'cypress/e2e/home.spec.ts'
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.12.1'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
- name: Build app
|
||||
run: npm run build
|
||||
- name: Run Playwright build smoke test
|
||||
run: npm run test:e2e -- --project chromium --config playwright.buildSmoke.config.ts tests/e2e/buildSmoke.spec.ts
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: test-artifacts-${{ runner.os }}
|
||||
retention-days: 30
|
||||
path: |
|
||||
tests/artifacts/**/*
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
name: check-e2e
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
check-e2e:
|
||||
strategy:
|
||||
matrix:
|
||||
browser: [chromium, firefox]
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.12.1'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
- name: Start http-api test server
|
||||
run: ./scripts/run-http-api-with-fixtures --non-interactive --detach
|
||||
- name: Run Playwright tests
|
||||
run: npm run test:e2e -- --project ${{ matrix.browser }}
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: test-artifacts-${{ runner.os }}
|
||||
retention-days: 30
|
||||
path: |
|
||||
tests/artifacts/**/*
|
||||
@@ -6,7 +6,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.12.1'
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
name: check-integration-test
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
chrome:
|
||||
runs-on: ubuntu-latest
|
||||
name: E2E on Chrome
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '18.12.1'
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v4
|
||||
with:
|
||||
browser: chrome
|
||||
start: npm start
|
||||
wait-on: 'http://localhost:3000'
|
||||
command: npm run test:e2e
|
||||
|
||||
@@ -2,15 +2,14 @@ name: check-unit-test
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
check-unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.12.1'
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- run: npm ci
|
||||
- run: ./scripts/unit-test
|
||||
shell: bash
|
||||
- run: npm run test:unit
|
||||
|
||||
@@ -6,7 +6,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.12.1'
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
Reference in New Issue
Block a user