webapp/tests/basic-routes.spec.ts

22 lines
671 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-25 11:25:20 +00:00
const pagesTitles: {[key:string]: RegExp } = {
2024-02-04 13:25:23 +00:00
'/': /Дискурс/,
2024-06-06 06:05:23 +00:00
'/feed': /Лента/,
'/create': /Выберите тип публикации/,
'/about/help': /Поддержите Дискурс/,
'/authors': /Авторы/,
'/topics': /Темы и сюжеты/,
'/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
})