Добавлены NewsAdminPage с описанием раздела Новости и admin-news-positive.spec с позитивным сценарием

This commit is contained in:
Vlad Smykov
2025-06-19 18:26:55 +03:00
parent 66f60f10e9
commit 88944c729f
40 changed files with 2110 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,606 @@
# Test info
- Name: Панель администратора — Новости (позитивный сценарий) >> Успешное добавление новости с изображением
- Location: /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:5:7
# Error details
```
Error: locator.click: Test timeout of 30000ms exceeded.
Call log:
- waiting for getByRole('link', { name: 'Панель администратора' })
at /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:14:69
```
# Page snapshot
```yaml
- main:
- img "logo"
- paragraph: Всероссийская научная конференция "Системный синтез и прикладная синергетика"
- list:
- listitem: Панель администратора
- listitem: Автору
- listitem: Участники
- listitem: Оргкомитет
- listitem: Личный кабинет
- img "Background"
- main:
- paragraph: 19 - 26 июня 2025 года Таганрог
- list
- img "Background"
- button "Подать заявку"
- img "Background"
- paragraph: / ЭТАПЫ ПРОВЕДЕНИЯ КОНФЕРЕНЦИИ /
- list:
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- paragraph: НАШИ КОНФЕРЕНЦИИ ПРОХОДЯТ С ПОЛЬЗОЙ НЕ ТОЛЬКО ДЛЯ РАЗВИТИЯ, НО И ДЛЯ ЗДОРОВЬЯ!
- paragraph: О конференции
- paragraph: НАПРАВЛЕНИЯ РАБОТЫ КОНФЕРЕНЦИИ
- paragraph: Направление
- paragraph: ewfewf
- paragraph: ewfewfewfwef
- img "ewfewf"
- button "Все новости img":
- text: Все новости
- img "img"
- paragraph: Организаторы
- img "Organization1"
- paragraph: Партнёры
- img "Organization1"
- paragraph: Всероссийская научная конференция "Системный синтез и прикладная синергетика"
- paragraph: 19 - 26 июня 2025 года Таганрог
- paragraph: "Напишите нам:"
- paragraph:
- text: "e-mail:"
- link "ssas@ictis.sfedu.ru":
- /url: mailto:ssas@ictis.sfedu.ru
- text: Сайт разработан Центром исследований и разработки ИКТИБ
- link "Ознакомиться с руководством пользователя":
- /url: /static/media/user_manual.f1df94e2c5143919fb0d.pdf
```
# Test source
```ts
1 | import { test, expect } from '@playwright/test';
2 | import path from 'path';
3 |
4 | test.describe('Панель администратора — Новости (позитивный сценарий)', () => {
5 | test('Успешное добавление новости с изображением', async ({ page }) => {
6 | // 1. Авторизация как администратор
7 | await page.goto('https://ssas.dev.rdcenter.ru/login/authorization');
8 | await page.getByPlaceholder('Email').fill('admin@sfedu.ru');
9 | await page.getByPlaceholder('Пароль').fill('dfDk1oQQ6YGV@');
10 | await page.getByRole('button', { name: 'Войти', exact: true }).click();
11 |
12 | // 2. Переход в раздел "Панель администратора" → "Новости"
13 | await page.waitForURL('**/');
> 14 | await page.getByRole('link', { name: 'Панель администратора' }).click();
| ^ Error: locator.click: Test timeout of 30000ms exceeded.
15 | await page.waitForURL('**/adminPage/news');
16 |
17 | // 3. Нажатие кнопки "Добавить новость"
18 | await page.getByRole('button', { name: 'Добавить новость' }).click();
19 |
20 | // 4. Заполнение формы
21 | const title = `Тестовая новость ${Date.now()}`;
22 | const content = 'Это автотестовая новость для проверки добавления.';
23 | const imagePath = path.resolve(__dirname, '../../../test-data/image_1mb.png');
24 |
25 | await page.getByPlaceholder('Заголовок').fill(title);
26 | await page.getByPlaceholder('Текст новости').fill(content);
27 |
28 | // 5. Загрузка изображения
29 | const fileInput = await page.locator('input[type="file"]');
30 | await fileInput.setInputFiles(imagePath);
31 |
32 | // 6. Нажатие на кнопку "Добавить"
33 | await page.getByRole('button', { name: 'Добавить' }).click();
34 |
35 | // 7. Проверка, что новость появилась в списке
36 | await expect(page.locator('table')).toContainText(title);
37 | });
38 | });
39 |
```

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,59 @@
# Test info
- Name: Панель администратора — Новости (позитивный сценарий) >> Успешное добавление новости с изображением
- Location: /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:5:7
# Error details
```
Error: locator.fill: Target page, context or browser has been closed
Call log:
- waiting for getByPlaceholder('Email')
at /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:8:42
```
# Test source
```ts
1 | import { test, expect } from '@playwright/test';
2 | import path from 'path';
3 |
4 | test.describe('Панель администратора — Новости (позитивный сценарий)', () => {
5 | test('Успешное добавление новости с изображением', async ({ page }) => {
6 | // 1. Авторизация как администратор
7 | await page.goto('https://ssas.dev.rdcenter.ru/login');
> 8 | await page.getByPlaceholder('Email').fill('admin@sfedu.ru');
| ^ Error: locator.fill: Target page, context or browser has been closed
9 | await page.getByPlaceholder('Пароль').fill('dfDk1oQQ6YGV@');
10 | await page.getByRole('button', { name: 'Войти' }).click();
11 |
12 | // 2. Переход в раздел "Панель администратора" → "Новости"
13 | await page.waitForURL('**/main');
14 | await page.getByRole('link', { name: 'Панель администратора' }).click();
15 | await page.waitForURL('**/adminPage/news');
16 |
17 | // 3. Нажатие кнопки "Добавить новость"
18 | await page.getByRole('button', { name: 'Добавить новость' }).click();
19 |
20 | // 4. Заполнение формы
21 | const title = `Тестовая новость ${Date.now()}`;
22 | const content = 'Это автотестовая новость для проверки добавления.';
23 | const imagePath = path.resolve(__dirname, '../../../test-data/image_1mb.png');
24 |
25 | await page.getByPlaceholder('Заголовок').fill(title);
26 | await page.getByPlaceholder('Текст новости').fill(content);
27 |
28 | // 5. Загрузка изображения
29 | const fileInput = await page.locator('input[type="file"]');
30 | await fileInput.setInputFiles(imagePath);
31 |
32 | // 6. Нажатие на кнопку "Добавить"
33 | await page.getByRole('button', { name: 'Добавить' }).click();
34 |
35 | // 7. Проверка, что новость появилась в списке
36 | await expect(page.locator('table')).toContainText(title);
37 | });
38 | });
39 |
```

View File

@@ -0,0 +1,606 @@
# Test info
- Name: Панель администратора — Новости (позитивный сценарий) >> Успешное добавление новости с изображением
- Location: /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:5:7
# Error details
```
Error: locator.click: Test timeout of 30000ms exceeded.
Call log:
- waiting for getByRole('link', { name: 'Панель администратора' })
at /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:14:69
```
# Page snapshot
```yaml
- main:
- img "logo"
- paragraph: Всероссийская научная конференция "Системный синтез и прикладная синергетика"
- list:
- listitem: Панель администратора
- listitem: Автору
- listitem: Участники
- listitem: Оргкомитет
- listitem: Личный кабинет
- img "Background"
- main:
- paragraph: 19 - 26 июня 2025 года Таганрог
- list
- img "Background"
- button "Подать заявку"
- img "Background"
- paragraph: / ЭТАПЫ ПРОВЕДЕНИЯ КОНФЕРЕНЦИИ /
- list:
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- paragraph: НАШИ КОНФЕРЕНЦИИ ПРОХОДЯТ С ПОЛЬЗОЙ НЕ ТОЛЬКО ДЛЯ РАЗВИТИЯ, НО И ДЛЯ ЗДОРОВЬЯ!
- paragraph: О конференции
- paragraph: НАПРАВЛЕНИЯ РАБОТЫ КОНФЕРЕНЦИИ
- paragraph: Направление
- paragraph: ewfewf
- paragraph: ewfewfewfwef
- img "ewfewf"
- button "Все новости img":
- text: Все новости
- img "img"
- paragraph: Организаторы
- img "Organization1"
- paragraph: Партнёры
- img "Organization1"
- paragraph: Всероссийская научная конференция "Системный синтез и прикладная синергетика"
- paragraph: 19 - 26 июня 2025 года Таганрог
- paragraph: "Напишите нам:"
- paragraph:
- text: "e-mail:"
- link "ssas@ictis.sfedu.ru":
- /url: mailto:ssas@ictis.sfedu.ru
- text: Сайт разработан Центром исследований и разработки ИКТИБ
- link "Ознакомиться с руководством пользователя":
- /url: /static/media/user_manual.f1df94e2c5143919fb0d.pdf
```
# Test source
```ts
1 | import { test, expect } from '@playwright/test';
2 | import path from 'path';
3 |
4 | test.describe('Панель администратора — Новости (позитивный сценарий)', () => {
5 | test('Успешное добавление новости с изображением', async ({ page }) => {
6 | // 1. Авторизация как администратор
7 | await page.goto('https://ssas.dev.rdcenter.ru/login/authorization');
8 | await page.getByPlaceholder('Email').fill('admin@sfedu.ru');
9 | await page.getByPlaceholder('Пароль').fill('dfDk1oQQ6YGV@');
10 | await page.getByRole('button', { name: 'Войти', exact: true }).click();
11 |
12 | // 2. Переход в раздел "Панель администратора" → "Новости"
13 | await page.waitForURL('**/');
> 14 | await page.getByRole('link', { name: 'Панель администратора' }).click();
| ^ Error: locator.click: Test timeout of 30000ms exceeded.
15 | await page.waitForURL('**/adminPage/news');
16 |
17 | // 3. Нажатие кнопки "Добавить новость"
18 | await page.getByRole('button', { name: 'Добавить новость' }).click();
19 |
20 | // 4. Заполнение формы
21 | const title = `Тестовая новость ${Date.now()}`;
22 | const content = 'Это автотестовая новость для проверки добавления.';
23 | const imagePath = path.resolve(__dirname, '../../../test-data/image_1mb.png');
24 |
25 | await page.getByPlaceholder('Заголовок').fill(title);
26 | await page.getByPlaceholder('Текст новости').fill(content);
27 |
28 | // 5. Загрузка изображения
29 | const fileInput = await page.locator('input[type="file"]');
30 | await fileInput.setInputFiles(imagePath);
31 |
32 | // 6. Нажатие на кнопку "Добавить"
33 | await page.getByRole('button', { name: 'Добавить' }).click();
34 |
35 | // 7. Проверка, что новость появилась в списке
36 | await expect(page.locator('table')).toContainText(title);
37 | });
38 | });
39 |
```

View File

@@ -0,0 +1,79 @@
# Test info
- Name: Панель администратора — Новости (позитивный сценарий) >> Успешное добавление новости с изображением
- Location: /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:5:7
# Error details
```
Error: locator.click: Target page, context or browser has been closed
Call log:
- waiting for getByRole('button', { name: 'Добавить' })
- locator resolved to <button class="AddNews_addNews__5VNyQ">Добавить</button>
- attempting click action
2 × waiting for element to be visible, enabled and stable
- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
- <div class="ImageCropper_editPhoto__BuumR">…</div> from <div class="ImageCropper_ImageCropper__8H9sV">…</div> subtree intercepts pointer events
- retrying click action
- waiting 20ms
- waiting for element to be visible, enabled and stable
- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
- <div class="ImageCropper_editPhoto__BuumR">…</div> from <div class="ImageCropper_ImageCropper__8H9sV">…</div> subtree intercepts pointer events
- retrying click action
- waiting 100ms
- waiting for element to be visible, enabled and stable
- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
at /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:33:58
```
# Test source
```ts
1 | import { test, expect } from '@playwright/test';
2 | import path from 'path';
3 |
4 | test.describe('Панель администратора — Новости (позитивный сценарий)', () => {
5 | test('Успешное добавление новости с изображением', async ({ page }) => {
6 | // 1. Авторизация как администратор
7 | await page.goto('https://ssas.dev.rdcenter.ru/login/authorization');
8 | await page.getByPlaceholder('Email').fill('admin@sfedu.ru');
9 | await page.getByPlaceholder('Пароль').fill('dfDk1oQQ6YGV@');
10 | await page.getByRole('button', { name: 'Войти', exact: true }).click();
11 |
12 | // 2. Переход в раздел "Панель администратора" → "Новости"
13 | await page.waitForURL('**/');
14 | await page.getByText('Панель администратора').click();
15 | await page.waitForURL('**/adminPage/news');
16 |
17 | // 3. Нажатие кнопки "Добавить новость"
18 | await page.getByRole('button', { name: 'Добавить новость' }).click();
19 |
20 | // 4. Заполнение формы
21 | const title = `Тестовая новость ${Date.now()}`;
22 | const content = 'Это автотестовая новость для проверки добавления.';
23 | const imagePath = path.resolve(__dirname, '../../../../utils/test-data/image_1mb.png');
24 |
25 | await page.getByPlaceholder('Заголовок').fill(title);
26 | await page.getByPlaceholder('Текст новости').fill(content);
27 |
28 | // 5. Загрузка изображения
29 | const fileInput = await page.locator('input[type="file"]');
30 | await fileInput.setInputFiles(imagePath);
31 |
32 | // 6. Нажатие на кнопку "Добавить"
> 33 | await page.getByRole('button', { name: 'Добавить' }).click();
| ^ Error: locator.click: Target page, context or browser has been closed
34 |
35 | // 7. Проверка, что новость появилась в списке
36 | await expect(page.locator('table')).toContainText(title);
37 | });
38 | });
39 |
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,606 @@
# Test info
- Name: Панель администратора — Новости (позитивный сценарий) >> Успешное добавление новости с изображением
- Location: /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:5:7
# Error details
```
Error: locator.click: Test timeout of 30000ms exceeded.
Call log:
- waiting for getByRole('link', { name: 'Панель администратора' })
at /Users/vladsmykov/Desktop/Work/AUTOTESTS/CCPC_playwright/tests/ui/admin/news/admin-news-positive.spec.ts:14:69
```
# Page snapshot
```yaml
- main:
- img "logo"
- paragraph: Всероссийская научная конференция "Системный синтез и прикладная синергетика"
- list:
- listitem: Панель администратора
- listitem: Автору
- listitem: Участники
- listitem: Оргкомитет
- listitem: Личный кабинет
- img "Background"
- main:
- paragraph: 19 - 26 июня 2025 года Таганрог
- list
- img "Background"
- button "Подать заявку"
- img "Background"
- paragraph: / ЭТАПЫ ПРОВЕДЕНИЯ КОНФЕРЕНЦИИ /
- list:
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- listitem:
- text: 19.06.2025
- paragraph: Этап
- paragraph
- img
- paragraph: НАШИ КОНФЕРЕНЦИИ ПРОХОДЯТ С ПОЛЬЗОЙ НЕ ТОЛЬКО ДЛЯ РАЗВИТИЯ, НО И ДЛЯ ЗДОРОВЬЯ!
- paragraph: О конференции
- paragraph: НАПРАВЛЕНИЯ РАБОТЫ КОНФЕРЕНЦИИ
- paragraph: Направление
- paragraph: ewfewf
- paragraph: ewfewfewfwef
- img "ewfewf"
- button "Все новости img":
- text: Все новости
- img "img"
- paragraph: Организаторы
- img "Organization1"
- paragraph: Партнёры
- img "Organization1"
- paragraph: Всероссийская научная конференция "Системный синтез и прикладная синергетика"
- paragraph: 19 - 26 июня 2025 года Таганрог
- paragraph: "Напишите нам:"
- paragraph:
- text: "e-mail:"
- link "ssas@ictis.sfedu.ru":
- /url: mailto:ssas@ictis.sfedu.ru
- text: Сайт разработан Центром исследований и разработки ИКТИБ
- link "Ознакомиться с руководством пользователя":
- /url: /static/media/user_manual.f1df94e2c5143919fb0d.pdf
```
# Test source
```ts
1 | import { test, expect } from '@playwright/test';
2 | import path from 'path';
3 |
4 | test.describe('Панель администратора — Новости (позитивный сценарий)', () => {
5 | test('Успешное добавление новости с изображением', async ({ page }) => {
6 | // 1. Авторизация как администратор
7 | await page.goto('https://ssas.dev.rdcenter.ru/login/authorization');
8 | await page.getByPlaceholder('Email').fill('admin@sfedu.ru');
9 | await page.getByPlaceholder('Пароль').fill('dfDk1oQQ6YGV@');
10 | await page.getByRole('button', { name: 'Войти', exact: true }).click();
11 |
12 | // 2. Переход в раздел "Панель администратора" → "Новости"
13 | await page.waitForURL('**/');
> 14 | await page.getByRole('link', { name: 'Панель администратора' }).click();
| ^ Error: locator.click: Test timeout of 30000ms exceeded.
15 | await page.waitForURL('**/adminPage/news');
16 |
17 | // 3. Нажатие кнопки "Добавить новость"
18 | await page.getByRole('button', { name: 'Добавить новость' }).click();
19 |
20 | // 4. Заполнение формы
21 | const title = `Тестовая новость ${Date.now()}`;
22 | const content = 'Это автотестовая новость для проверки добавления.';
23 | const imagePath = path.resolve(__dirname, '../../../test-data/image_1mb.png');
24 |
25 | await page.getByPlaceholder('Заголовок').fill(title);
26 | await page.getByPlaceholder('Текст новости').fill(content);
27 |
28 | // 5. Загрузка изображения
29 | const fileInput = await page.locator('input[type="file"]');
30 | await fileInput.setInputFiles(imagePath);
31 |
32 | // 6. Нажатие на кнопку "Добавить"
33 | await page.getByRole('button', { name: 'Добавить' }).click();
34 |
35 | // 7. Проверка, что новость появилась в списке
36 | await expect(page.locator('table')).toContainText(title);
37 | });
38 | });
39 |
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -0,0 +1,103 @@
import { Page, Locator } from '@playwright/test';
import path from 'path';
export class NewsAdminPage {
readonly page: Page;
// Авторизация
readonly emailInput: Locator;
readonly passwordInput: Locator;
readonly loginButton: Locator;
// Навигация
readonly adminPanelLink: Locator;
// Элементы добавления новости
readonly addNewsButton: Locator;
readonly titleTextarea: Locator;
readonly contentTextarea: Locator;
readonly fileInput: Locator;
readonly cropSaveButton: Locator;
readonly confirmAddButton: Locator;
// Таблица новостей
readonly newsTable: Locator;
// Ошибки
readonly emptyTitleError: Locator;
readonly emptyContentError: Locator;
constructor(page: Page) {
this.page = page;
// Авторизация
this.emailInput = page.getByPlaceholder('Email');
this.passwordInput = page.getByPlaceholder('Пароль');
this.loginButton = page.getByRole('button', { name: 'Войти', exact: true });
// Навигация
this.adminPanelLink = page.getByText('Панель администратора');
// Форма добавления новости
this.addNewsButton = page.getByRole('button', { name: 'Добавить новость' });
this.titleTextarea = page.getByPlaceholder('Заголовок');
this.contentTextarea = page.getByPlaceholder('Текст новости');
this.fileInput = page.locator('input[type="file"]');
this.cropSaveButton = page.getByRole('button', { name: 'Сохранить' });
this.confirmAddButton = page.getByRole('button', { name: 'Добавить' });
// Таблица новостей
this.newsTable = page.locator('table');
// Ошибки валидации
this.emptyTitleError = page.getByText('Заголовок новости не может быть пустым.');
this.emptyContentError = page.getByText('Текст новости не может быть пустым.');
}
async loginAsAdmin() {
await this.page.goto('https://ssas.dev.rdcenter.ru/login/authorization');
await this.emailInput.fill('admin@sfedu.ru');
await this.passwordInput.fill('dfDk1oQQ6YGV@');
await this.loginButton.click();
}
async navigateToNewsSection() {
await this.page.waitForURL('**/');
await this.adminPanelLink.click();
await this.page.waitForURL('**/adminPage/news');
}
async goto() {
await this.page.waitForURL('**/');
await this.adminPanelLink.click();
await this.page.waitForURL('**/adminPage/news');
}
async addNews(params: { title: string; content: string; imagePath: string }) {
const { title, content, imagePath } = params;
await this.addNewsButton.click();
await this.titleTextarea.fill(title);
await this.contentTextarea.fill(content);
await this.fileInput.setInputFiles(imagePath);
await this.cropSaveButton.click();
await this.confirmAddButton.click();
}
async verifyNewsAppears(title: string) {
await this.page.waitForLoadState('networkidle');
await this.newsTable.waitFor();
await this.page.getByText(title).waitFor({ state: 'visible' });
}
async addEmptyNews() {
await this.addNewsButton.click();
await this.confirmAddButton.click();
}
async verifyValidationErrors() {
await this.emptyTitleError.waitFor({ state: 'visible' });
await this.emptyContentError.waitFor({ state: 'visible' });
}
}

View File

@@ -0,0 +1,39 @@
import { test, expect } from '@playwright/test';
import path from 'path';
test.describe('Панель администратора — Новости (позитивный сценарий)', () => {
test('Успешное добавление новости с изображением', async ({ page }) => {
// 1. Авторизация как администратор
await page.goto('https://ssas.dev.rdcenter.ru/login/authorization');
await page.getByPlaceholder('Email').fill('admin@sfedu.ru');
await page.getByPlaceholder('Пароль').fill('dfDk1oQQ6YGV@');
await page.getByRole('button', { name: 'Войти', exact: true }).click();
// 2. Переход в раздел "Панель администратора" → "Новости"
await page.waitForURL('**/');
await page.getByText('Панель администратора').click();
await page.waitForURL('**/adminPage/news');
// 3. Нажатие кнопки "Добавить новость"
await page.getByRole('button', { name: 'Добавить новость' }).click();
// 4. Заполнение формы
const title = `Тестовая новость ${Date.now()}`;
const content = 'Это автотестовая новость для проверки добавления.';
const imagePath = path.resolve(__dirname, '../../../../utils/test-data/image_1mb.png');
await page.getByPlaceholder('Заголовок').fill(title);
await page.getByPlaceholder('Текст новости').fill(content);
// 5. Загрузка изображения
const fileInput = await page.locator('input[type="file"]');
await fileInput.setInputFiles(imagePath);
await page.getByRole('button', { name: 'Сохранить' }).click();
// 6. Нажатие на кнопку "Добавить"
await page.getByRole('button', { name: 'Добавить' }).click();
// 7. Проверка, что новость появилась в списке
await expect(page.locator('table')).toContainText(title);
});
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB