mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-09-27 21:34:42 +02:00
testing
This commit is contained in:
parent
c7088a8b43
commit
ce07ca8b0d
2
.github/workflows/test.yaml
vendored
2
.github/workflows/test.yaml
vendored
@ -27,7 +27,7 @@ jobs:
|
||||
- name: Install Playwright
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run your tests
|
||||
run: npm test
|
||||
run: pnpm run test
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,3 +9,6 @@ node_modules
|
||||
/build
|
||||
/functions
|
||||
.env
|
||||
|
||||
General
|
||||
test-results
|
||||
|
@ -3,7 +3,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"preview": "svelte-kit preview",
|
||||
"preview": "vite preview --port 3000",
|
||||
"check": "svelte-check --tsconfig tsconfig.json",
|
||||
"licenses": "license-checker --summary > licenses.csv",
|
||||
"locale:download": "node scripts/locale.js"
|
||||
|
@ -5,9 +5,14 @@
|
||||
"dev:front": "pnpm --prefix frontend run dev",
|
||||
"dev:proxy": "node proxy.mjs",
|
||||
"dev": "run-p dev:*",
|
||||
"test": "playwright test",
|
||||
"ci:server": "run-p ci:server:*",
|
||||
"ci:server:backend": "cd backend && cargo run",
|
||||
"ci:server:front": "pnpm --prefix frontend run preview",
|
||||
"ci:server:proxy": "node proxy.mjs",
|
||||
"ci:prepare": "run-p ci:prepare:*",
|
||||
"ci:prepare:backend": "cd backend && cargo build",
|
||||
"ci:prepare:front": "pnpm --prefix frontend install"
|
||||
"ci:prepare:front": "pnpm --prefix frontend install && pnpm --prefix frontend run build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.23.4",
|
||||
|
@ -1,18 +1,25 @@
|
||||
import type { PlaywrightTestConfig } from '@playwright/test'
|
||||
import { devices, type PlaywrightTestConfig } from '@playwright/test'
|
||||
|
||||
const config: PlaywrightTestConfig = {
|
||||
use: {
|
||||
video: 'on-first-retry',
|
||||
video: 'retain-on-failure',
|
||||
baseURL: 'http://localhost:1234',
|
||||
actionTimeout: 3_000,
|
||||
// actionTimeout: 10_000,
|
||||
},
|
||||
outputDir: './test-results',
|
||||
testDir: './test',
|
||||
testMatch: /.*\.ts/,
|
||||
webServer: {
|
||||
command: 'pnpm run dev',
|
||||
command: 'pnpm run ci:server',
|
||||
port: 1234,
|
||||
reuseExistingServer: true,
|
||||
timeout: 20_000,
|
||||
},
|
||||
projects: [
|
||||
{ name: 'Chrome', use: { ...devices['Desktop Chrome'] } },
|
||||
{ name: 'Firefox', use: { ...devices['Desktop Firefox'] } },
|
||||
{ name: 'Safari', use: { ...devices['Desktop Safari'] } },
|
||||
],
|
||||
}
|
||||
|
||||
export default config
|
||||
|
@ -18,6 +18,7 @@ async function checkLinkForText(page: Page, link: string, text: string) {
|
||||
}
|
||||
|
||||
async function checkLinkDoesNotExist(page: Page, link: string) {
|
||||
await page.goto('/') // Required due to firefox: https://github.com/microsoft/playwright/issues/15781
|
||||
await page.goto(link)
|
||||
await expect(page.locator('main')).toContainText('note was not found or was already deleted')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user