e2e-update

This commit is contained in:
Untone 2024-10-03 16:55:59 +03:00
parent 4a4b879d7b
commit e67df403c5

View File

@ -72,7 +72,7 @@ test.beforeEach(async ({ page }) => {
await page.getByRole('button', { name: 'Войти' }).click() await page.getByRole('button', { name: 'Войти' }).click()
}) })
test.describe('*****Undone***** Drafts - article', () => { test.describe('Create new draft', () => {
test('Open /edit/new', async ({ page }) => { test('Open /edit/new', async ({ page }) => {
await page.goto('/edit/new') await page.goto('/edit/new')
await expect(page).toHaveTitle('Выберите тип публикации') await expect(page).toHaveTitle('Выберите тип публикации')
@ -84,28 +84,23 @@ test('Create article', async ({ page }) => {
await page.locator('li').filter({ hasText: 'статья' }).locator('img').click() await page.locator('li').filter({ hasText: 'статья' }).locator('img').click()
}) })
/*
test('Check Draft', async ({ page }) => {});
test('Drafts - create literature', async ({ page }) => { test('Drafts - create literature', async ({ page }) => {
await page.getByRole('button', { name: 'Т.Р' }).click(); await page.getByRole('button', { name: 'Т.Р' }).click();
await page.getByRole('link', { name: 'Черновики' }).click(); await page.getByRole('link', { name: 'Черновики' }).click();
await page.getByRole('link', { name: 'Создать публикацию' }).click(); await page.getByRole('link', { name: 'Создать публикацию' }).click();
// biome-ignore lint/performance/useTopLevelRegex: <explanation>
await page.locator('li').filter({ hasText: /^литература$/ }).locator('img').click(); await page.locator('li').filter({ hasText: /^литература$/ }).locator('img').click();
}); });
*/ test('Drafts - create images', async ({ page }) => {
/* test('Drafts - create images', async ({ page }) => {
await page.getByRole('button', { name: 'Т.Р' }).click(); await page.getByRole('button', { name: 'Т.Р' }).click();
await page.getByRole('link', { name: 'Черновики' }).click(); await page.getByRole('link', { name: 'Черновики' }).click();
await page.getByRole('link', { name: 'Создать публикацию' }).click(); await page.getByRole('link', { name: 'Создать публикацию' }).click();
await page.locator('li').filter({ hasText: 'изображения' }).locator('img').click(); await page.locator('li').filter({ hasText: 'изображения' }).locator('img').click();
Fill the form // Fill the form
Save // Save
Check is it created // Check is it created
}); */ });
test('Drafts - create music', async ({ page }) => { test('Drafts - create music', async ({ page }) => {
await page.getByRole('button', { name: 'Т.Р.' }).click() await page.getByRole('button', { name: 'Т.Р.' }).click()
@ -117,17 +112,19 @@ test('Drafts - create music', async ({ page }) => {
// TODO: Check is it created // TODO: Check is it created
}) })
/* test('Drafts - create video', async ({ page }) => { test('Drafts - create video', async ({ page }) => {
await page.getByRole('button', { name: 'Т.Р' }).click(); await page.getByRole('button', { name: 'Т.Р' }).click();
await page.getByRole('link', { name: 'Черновики' }).click(); await page.getByRole('link', { name: 'Черновики' }).click();
await page.getByRole('link', { name: 'Создать публикацию' }).click(); await page.getByRole('link', { name: 'Создать публикацию' }).click();
await page.locator('li').filter({ hasText: 'видео' }).locator('img').click(); await page.locator('li').filter({ hasText: 'видео' }).locator('img').click();
Fill the form // Fill the form
Save // Save
Check is it created // Check is it created
}); */ });
/* test('Post topic', async ({ page }) => { test('Post topic', async ({ page }) => {
Open Draft await page.getByRole('button', { name: 'Т.Р.' }).click()
Post await page.getByRole('link', { name: 'Черновики' }).click()
});*/ await page.getByRole('link', { name: 'Создать публикацию' }).click()
// Post
});