diff --git a/playwright.config.ts b/playwright.config.ts index b3bf954d..0616c11f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -17,7 +17,7 @@ export default defineConfig({ /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, + retries: 0, /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ diff --git a/tests/2-auth-topics-actions.spec.ts b/tests/2-auth-topic-actions.spec.ts similarity index 65% rename from tests/2-auth-topics-actions.spec.ts rename to tests/2-auth-topic-actions.spec.ts index 29f03204..c05bce4c 100644 --- a/tests/2-auth-topics-actions.spec.ts +++ b/tests/2-auth-topic-actions.spec.ts @@ -60,18 +60,6 @@ test.afterAll(async () => { }) /* TESTS section */ - -/* Random Generator */ -function generateRandomString(length = 10) { - let result = '' - const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' - const charactersLength = characters.length - for (let i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)) - } - return result -} - test.beforeEach(async ({ page }) => { await page.goto('/') /* test.setTimeout(80000); */ @@ -104,26 +92,4 @@ test.describe('Topic Actions', () => { await page.getByRole('button', { name: 'Отписаться от темы' }).click() await expect(page.getByRole('button', { name: 'Подписаться на тему' })).toBeVisible() }) - test('Add comment to topic', async ({ page }) => { - const randomString = generateRandomString() - const currentDate = new Date() - await page.getByRole('button', { name: 'Т.Р' }).click() - await page.getByRole('link', { name: 'Профиль' }).click() - await page.getByRole('link', { name: 'Тестируем функционал' }).first().click() - await page.locator('.tiptap').click() - await page.locator('.tiptap').fill(`Проверка Комментариев: ${randomString} ${currentDate}`) - await page.getByRole('button', { name: 'Отправить' }).click() - await expect(page.getByText(`Проверка Комментариев: ${randomString} ${currentDate}`)).toBeVisible() - }) - test('Edit comment to topic', async ({ page }) => { - await page.getByRole('button', { name: 'Т.Р' }).click() - await page.getByRole('link', { name: 'Комментарии' }).click() - await page.locator('[id^="comment_"]').filter({ hasText: 'Проверка Комментариев' }).first().hover() - await page.getByRole('button', { name: 'Редактировать', exact: true }).first().click() - const randomString = generateRandomString() - const currentDate = new Date() - await page.locator('.tiptap').fill(`Редактируемый Комментарий: ${randomString} ${currentDate}`) - await page.getByRole('button', { name: 'Сохранить' }).click() - await expect(page.getByText(`Редактируемый Комментарий: ${randomString} ${currentDate}`)).toBeVisible() - }) }) diff --git a/tests/3-auth-drafts-actions.spec.ts b/tests/3-auth-drafts-actions.spec.ts index 650cdab8..28e3ca46 100644 --- a/tests/3-auth-drafts-actions.spec.ts +++ b/tests/3-auth-drafts-actions.spec.ts @@ -78,24 +78,23 @@ test.describe('*****Undone***** Drafts - article', () => { }) }) -/* test('Create article', async ({ page }) => { - await page.goto(`/create`); +test('Create article', async ({ page }) => { + await page.goto('/edit/new'); await page.locator('li').filter({ hasText: 'статья' }).locator('img').click(); }); -test('Check Draft', async ({ page }) => { +/* -}); */ +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('link', { name: 'Черновики' }).click(); await page.getByRole('link', { name: 'Создать публикацию' }).click(); await page.locator('li').filter({ hasText: /^литература$/ }).locator('img').click(); - Fill the form - Save - Check is it created -}); */ +}); + +*/ /* test('Drafts - create images', async ({ page }) => { await page.getByRole('button', { name: 'Т.Р' }).click(); @@ -107,15 +106,15 @@ test('Check Draft', async ({ page }) => { Check is it created }); */ -/* test('Drafts - create music', async ({ page }) => { - await page.getByRole('button', { name: 'Т.Р' }).click(); +test('Drafts - create music', async ({ page }) => { + await page.getByRole('button', { name: 'Т.Р.' }).click(); await page.getByRole('link', { name: 'Черновики' }).click(); await page.getByRole('link', { name: 'Создать публикацию' }).click(); await page.locator('li').filter({ hasText: 'музыка' }).locator('img').click(); - Fill the form - Save - Check is it created -}); */ + // TODO: Fill the form + // TODO: Save + // TODO: Check is it created +}); /* test('Drafts - create video', async ({ page }) => { await page.getByRole('button', { name: 'Т.Р' }).click(); diff --git a/tests/4-auth-user-actions.spec.ts b/tests/4-auth-author-actions.spec.ts similarity index 100% rename from tests/4-auth-user-actions.spec.ts rename to tests/4-auth-author-actions.spec.ts