e2e
This commit is contained in:
parent
1f8b6342b0
commit
e95558fb51
|
@ -26,6 +26,9 @@ jobs:
|
|||
- name: Check types
|
||||
run: npm run typecheck
|
||||
|
||||
- name: Test production build
|
||||
run: npm run build
|
||||
|
||||
Playwright:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -40,10 +43,13 @@ jobs:
|
|||
run: npx playwright install --with-deps
|
||||
|
||||
- name: Start Web Server
|
||||
run: npm start &
|
||||
run: npm start > server.log 2>&1 &
|
||||
- name: Web Server startup log
|
||||
run: sleep 10 && cat server.log
|
||||
|
||||
|
||||
- name: Run Playwright tests
|
||||
run: npx playwright test
|
||||
run: npm run e2e
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
|
|
22
.github/workflows/node-ci.yml
vendored
22
.github/workflows/node-ci.yml
vendored
|
@ -26,23 +26,5 @@ jobs:
|
|||
- name: Check types
|
||||
run: npm run typecheck
|
||||
|
||||
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: Run Playwright tests
|
||||
run: npx playwright test
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
- name: Test production build
|
||||
run: npm run build
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021-2023 Discours
|
||||
Copyright (c) 2021-2024 Discours
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"codegen": "graphql-codegen",
|
||||
"deploy": "graphql-codegen && npm run typecheck && vite build && vercel",
|
||||
"dev": "vite",
|
||||
"e2e": "npx playwright test --project=chromium",
|
||||
"fix": "npm run lint:code:fix && npm run lint:styles:fix",
|
||||
"format": "npx @biomejs/biome format src/. --write",
|
||||
"hygen": "HYGEN_TMPLS=gen hygen",
|
||||
|
|
|
@ -1,30 +1,21 @@
|
|||
import { expect, test } from '@playwright/test'
|
||||
|
||||
const baseHost = 'https://localhost:3000'
|
||||
|
||||
const pagesTitles = {
|
||||
'http://localhost:3000/': 'Дискурс',
|
||||
'http://localhost:3000/feed': 'Дискурс: лента',
|
||||
'http://localhost:3000/create': 'Дискурс',
|
||||
'http://localhost:3000/about/donate': 'Дискурс: поддержка',
|
||||
'http://localhost:3000/authors': 'Дискурс: авторы',
|
||||
'http://localhost:3000/topics': 'Дискурс: темы',
|
||||
'http://localhost:3000/inbox': 'Дискурс',
|
||||
'/': /Дискурс/,
|
||||
'/feed': /Дискурс/,
|
||||
'/create': /Дискурс/,
|
||||
'/about/donate': /Дискурс/,
|
||||
'/authors': /Дискурс/,
|
||||
'/topics': /Дискурс/,
|
||||
'/inbox': /Дискурс/,
|
||||
}
|
||||
|
||||
test('has title', async ({ page }) => {
|
||||
await page.goto('http://localhost:3000/')
|
||||
|
||||
// Expect a title "to contain" a substring.
|
||||
await expect(page).toHaveTitle(/Дискурс/)
|
||||
})
|
||||
|
||||
test('check some links', async ({ page }) => {
|
||||
await page.goto('http://localhost:3000/feed')
|
||||
|
||||
await expect(page).toHaveTitle(/Дискурс/)
|
||||
|
||||
// Click the get started link.
|
||||
// await page.getByRole('link', { name: 'Get started' }).click();
|
||||
|
||||
// Expects page to have a heading with the name of Installation.
|
||||
//await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
|
||||
Object.keys(pagesTitles).forEach((res: string) => {
|
||||
test(`страница ${res}`, async ({ page }) => {
|
||||
await page.goto(`${baseHost}${res}`)
|
||||
const title = pagesTitles[res]
|
||||
await expect(page).toHaveTitle(title)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user