e2e-test-github
Some checks failed
deploy / test (push) Successful in 2m36s
deploy / Update templates on Mailgun (push) Has been skipped
deploy / push (push) Failing after 1s

This commit is contained in:
Untone 2024-02-04 16:39:26 +03:00
parent e95558fb51
commit 577aaaf9f2
3 changed files with 24 additions and 34 deletions

View File

@ -3,7 +3,7 @@ name: "deploy"
on: [push] on: [push]
jobs: jobs:
Linting: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -29,42 +29,14 @@ jobs:
- name: Test production build - name: Test production build
run: npm run build run: npm run build
Playwright: push:
timeout-minutes: 60 needs: test
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
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Push changes - name: Push changes
uses: ad-m/github-push-action@master uses: ad-m/github-push-action@master
Mailgun: email-templates:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Update templates on Mailgun name: Update templates on Mailgun
if: github.event_name == 'push' && github.ref == 'refs/heads/feature/email-templates' if: github.event_name == 'push' && github.ref == 'refs/heads/feature/email-templates'

View File

@ -3,7 +3,7 @@ name: "deploy"
on: [push] on: [push]
jobs: jobs:
Linting: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -28,3 +28,21 @@ jobs:
- name: Test production build - name: Test production build
run: npm run 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 }}

View File

@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test' import { expect, test } from '@playwright/test'
const baseHost = 'https://localhost:3000' const baseHost = process.env.BASE_URL
const pagesTitles = { const pagesTitles = {
'/': /Дискурс/, '/': /Дискурс/,