Skip to content

Commit

Permalink
Add plugin e2e tests and remove cypress (#390)
Browse files Browse the repository at this point in the history
* Add plugin e2e tests and remove cypress

* empty line added

* playwright config updated

* update e2e; wait load form

* updated e2e and added actions/upload-artifact

* e2e.json updated; png file updated

* docker compose typo updated

* Update workflow

* Add Diff ration

---------

Co-authored-by: Mikhail Volkov <[email protected]>
  • Loading branch information
vitPinchuk and mikhail-vl authored Apr 18, 2024
1 parent f9c41b0 commit 7fe03eb
Show file tree
Hide file tree
Showing 15 changed files with 7,835 additions and 12,134 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ server-mysql/
server-pg/

__mocks__

# Playwright tests
playwright.config.ts
test/panel.spec.ts
13 changes: 8 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ jobs:
- name: Build
run: npm run build

- name: Setup playwright browser
run: npx playwright install --with-deps chromium

- name: Start Grafana
run: docker-compose -f docker-compose-e2e.yml up -d

- name: Run e2e tests
run: npm run e2e
run: npm run test:e2e

- name: Stop Grafana
run: docker-compose down

- uses: actions/upload-artifact@v4
if: failure()
if: ${{ !cancelled() }}
with:
path: |
cypress/videos
cypress/screenshots/actual
name: playwright-report
path: playwright-report/
retention-days: 30
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: E2E Main

on:
push:
branches:
- main
pull_request:
branches:
- main

schedule:
- cron: '0 0 * * *'

workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Sign plugin
run: npm run sign
env:
GRAFANA_ACCESS_POLICY_TOKEN: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}

- name: Setup playwright browser
run: npx playwright install --with-deps chromium

- name: Start Grafana
run: docker-compose -f test/docker-compose.yml up -d

- name: Run e2e tests
run: npm run test:e2e

- name: Stop Grafana
run: docker-compose down
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ e2e-results/
.idea
.DS_Store

# Cypress
cypress/report.json
cypress/videos/
cypress/screenshots/actual
# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Add Checkbox List element (#382)
- Update syntax support in Code Editor (#383)
- Add plugin e2e tests and remove cypress (#390)

## 3.7.0 (2024-03-10)

Expand Down
41 changes: 0 additions & 41 deletions cypress/integration/01-view-panel.test.ts

This file was deleted.

Binary file not shown.
5 changes: 0 additions & 5 deletions cypress/tsconfig.json

This file was deleted.

Loading

0 comments on commit 7fe03eb

Please sign in to comment.