Добавил LoginPage,а также позитивные UI, API тесты для авторизации пользователя
This commit is contained in:
18
tests/api/auth/login-applicant.api.spec.ts
Normal file
18
tests/api/auth/login-applicant.api.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import axios from 'axios';
|
||||
|
||||
const BASE_URL = 'https://rumc.dev.rdcenter.ru/api';
|
||||
|
||||
test('API: успешная авторизация абитуриента', async () => {
|
||||
const payload = {
|
||||
login: 'autotestapplicant',
|
||||
password: '!Test123456',
|
||||
};
|
||||
|
||||
const res = await axios.post(`${BASE_URL}/auth/login`, payload);
|
||||
|
||||
expect(res.status).toBe(200);
|
||||
expect(res.data).toHaveProperty('access_token');
|
||||
|
||||
console.log('✅ Авторизация успешна. Access token:', res.data.access_token);
|
||||
});
|
||||
Reference in New Issue
Block a user