feat: e2e test on github actions (#212)
This commit is contained in:
39
.github/workflows/e2e.yml
vendored
Normal file
39
.github/workflows/e2e.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: E2E Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ "main"]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Docker Compose
|
||||
run: |
|
||||
sudo apt install -y docker-compose
|
||||
|
||||
- name: Install Playwright
|
||||
run: npx playwright install
|
||||
|
||||
- name: Start docker containers
|
||||
run: docker-compose up --build
|
||||
|
||||
- name: Run E2E tests
|
||||
run: npm run e2e
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
@@ -2,5 +2,5 @@ import { test, expect } from '@playwright/test';
|
||||
|
||||
test('has title', async ({ page }) => {
|
||||
await page.goto('http://localhost:8000/');
|
||||
await expect(page).toHaveTitle('Open Source Test Case Management System');
|
||||
await expect(page).toHaveTitle('Open Source Test Case Management System | UnitTCMS');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user