feat: добавил тесты с использованием Playwright
Frontend CI / build-and-check (push) Failing after 19s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 8s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 8s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 20s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 3s
Frontend CI / build-and-check (push) Failing after 19s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 8s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 8s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 20s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 3s
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { expect, test } from '@playwright/test'
|
||||
import { mockApi } from './support/mockApi'
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await mockApi(page, { authenticated: true })
|
||||
})
|
||||
|
||||
test('renders catalog items from mock api', async ({ page }) => {
|
||||
await page.goto('/catalog')
|
||||
|
||||
await expect(page.getByRole('heading', { name: 'Каталог открытых лекций' })).toBeVisible()
|
||||
await expect(page.getByText('Введение в ML')).toBeVisible()
|
||||
await expect(page.getByText('Квантовые вычисления')).toBeVisible()
|
||||
})
|
||||
|
||||
test('register button works for available lecture', async ({ page }) => {
|
||||
await page.goto('/catalog')
|
||||
|
||||
const firstRegisterButton = page.getByRole('button', { name: 'Записаться' }).first()
|
||||
await firstRegisterButton.click()
|
||||
|
||||
await expect(page.getByText('Вы записаны на лекцию.')).toBeVisible()
|
||||
})
|
||||
Reference in New Issue
Block a user