e2e-test-github
This commit is contained in:
parent
e95558fb51
commit
577aaaf9f2
|
@ -3,7 +3,7 @@ name: "deploy"
|
|||
on: [push]
|
||||
|
||||
jobs:
|
||||
Linting:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
@ -29,42 +29,14 @@ jobs:
|
|||
- name: Test production build
|
||||
run: npm run build
|
||||
|
||||
Playwright:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
|
||||
- name: Start Web Server
|
||||
run: npm start > server.log 2>&1 &
|
||||
- name: Web Server startup log
|
||||
run: sleep 10 && cat server.log
|
||||
|
||||
|
||||
- name: Run Playwright tests
|
||||
run: npm run e2e
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
|
||||
Github:
|
||||
needs: test_with_playwright
|
||||
push:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
|
||||
Mailgun:
|
||||
email-templates:
|
||||
runs-on: ubuntu-latest
|
||||
name: Update templates on Mailgun
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/feature/email-templates'
|
||||
|
|
20
.github/workflows/node-ci.yml
vendored
20
.github/workflows/node-ci.yml
vendored
|
@ -3,7 +3,7 @@ name: "deploy"
|
|||
on: [push]
|
||||
|
||||
jobs:
|
||||
Linting:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
@ -28,3 +28,21 @@ jobs:
|
|||
|
||||
- name: Test production build
|
||||
run: npm run build
|
||||
|
||||
e2e:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.deployment_status.state == 'success'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run Playwright tests
|
||||
run: npx playwright test
|
||||
env:
|
||||
BASE_URL: ${{ github.event.deployment_status.target_url }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { expect, test } from '@playwright/test'
|
||||
|
||||
const baseHost = 'https://localhost:3000'
|
||||
const baseHost = process.env.BASE_URL
|
||||
|
||||
const pagesTitles = {
|
||||
'/': /Дискурс/,
|
||||
|
|
Loading…
Reference in New Issue
Block a user