webapp/tests/basic-routes.spec.ts

22 lines
675 B
TypeScript
Raw Normal View History

2024-02-04 12:26:47 +00:00
import { expect, test } from '@playwright/test'
2024-06-06 09:27:49 +00:00
const baseHost = process.env.BASE_HOST || 'https://localhost:3000'
2024-02-04 13:25:23 +00:00
2024-06-26 08:22:05 +00:00
const pagesTitles: { [key: string]: RegExp } = {
2024-02-04 13:25:23 +00:00
'/': /Дискурс/,
2024-06-06 06:05:23 +00:00
'/feed': /Лента/,
2024-07-03 21:25:03 +00:00
'/edit/new': /Выберите тип публикации/,
'/guide/support': /Поддержите Дискурс/,
'/author': /Авторы/,
'/topic': /Темы и сюжеты/,
2024-06-26 08:22:05 +00:00
'/inbox': /Входящие/
2024-02-04 12:26:47 +00:00
}
2024-02-04 13:25:23 +00:00
Object.keys(pagesTitles).forEach((res: string) => {
test(`страница ${res}`, async ({ page }) => {
await page.goto(`${baseHost}${res}`)
const title = pagesTitles[res]
await expect(page).toHaveTitle(title)
})
2024-02-04 12:26:47 +00:00
})