e2e tests fine

This commit is contained in:
Untone 2024-06-06 09:05:23 +03:00
parent cada98f135
commit d249cb050d
4 changed files with 26 additions and 25 deletions

View File

@ -13,7 +13,6 @@
"e2e": "npx playwright test --project=chromium",
"fix": "npm run check:code:fix && stylelint **/*.{scss,css} --fix",
"format": "npx @biomejs/biome format src/. --write",
"hygen": "HYGEN_TMPLS=gen hygen",
"postinstall": "npm run codegen && npx patch-package",
"check:code": "npx @biomejs/biome check src --log-kind=compact --verbose",
"check:code:fix": "npx @biomejs/biome check . --apply",
@ -137,5 +136,7 @@
"y-prosemirror": "1.2.5",
"yjs": "13.6.15"
},
"trustedDependencies": ["@biomejs/biome"]
}
"trustedDependencies": [
"@biomejs/biome"
]
}

View File

@ -37,6 +37,7 @@ export default defineConfig({
use: { ...devices['Desktop Chrome'] },
},
/* Test against many viewports.
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
@ -46,8 +47,7 @@ export default defineConfig({
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
/* Test against mobile viewports. */
*/
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
@ -68,10 +68,10 @@ export default defineConfig({
// },
],
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
/* Run local dev server before starting the tests */
//webServer: {
// command: 'npm run dev',
// url: 'https://localhost:3000',
// reuseExistingServer: !process.env.CI,
//},
})

View File

@ -1,15 +1,15 @@
import { expect, test } from '@playwright/test'
const baseHost = process.env.BASE_URL
const baseHost = process.env.BASE_HOST || 'https://localhost:3000';
const pagesTitles = {
'/': /Дискурс/,
'/feed': /Дискурс/,
'/create': /Дискурс/,
'/about/donate': /Дискурс/,
'/authors': /Дискурс/,
'/topics': /Дискурс/,
'/inbox': /Дискурс/,
'/feed': /Лента/,
'/create': /Выберите тип публикации/,
'/about/help': /Поддержите Дискурс/,
'/authors': /Авторы/,
'/topics': /Темы и сюжеты/,
'/inbox': /Входящие/,
}
Object.keys(pagesTitles).forEach((res: string) => {

View File

@ -5,13 +5,13 @@ import { chromium } from 'playwright'
// Define the URLs to visit
const pagesToVisit = [
'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',
'https://localhost:3000/',
'https://localhost:3000/feed',
'https://localhost:3000/create',
'https://localhost:3000/about/donate',
'https://localhost:3000/authors',
'https://localhost:3000/topics',
'https://localhost:3000/inbox',
]
// Loop through the pages and visit each one