From dda4f88b260175dc720339d9eb30141f204e5f22 Mon Sep 17 00:00:00 2001 From: Alex Velichko Date: Mon, 18 Dec 2023 23:16:45 +0300 Subject: [PATCH] feat(tests): updated flaky tests Signed-off-by: Alex Velichko --- tests/sanity/tests/actions.spec.ts | 5 +++-- tests/sanity/tests/model/tracker/issues-details-page.ts | 2 +- tests/sanity/tests/tracker/tracker.spec.ts | 9 +++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/sanity/tests/actions.spec.ts b/tests/sanity/tests/actions.spec.ts index b5e6f2d0ddb..85272b07d13 100644 --- a/tests/sanity/tests/actions.spec.ts +++ b/tests/sanity/tests/actions.spec.ts @@ -40,7 +40,7 @@ test.describe('actions tests', () => { await page.click('div.actionsHeader input.actionsInput') await page.fill('div.actionsHeader input.actionsInput', 'go to ') - await page.waitForTimeout(500) + await page.waitForTimeout(1000) expect(await page.locator('div.selectPopup div.list-item :text("Go To Vacancies")').count()).toBe(1) await page.click('div.selectPopup div.list-item :text("Go To Vacancies")', { delay: 100 }) @@ -61,7 +61,8 @@ test.describe('actions tests', () => { await page.click('div.actionsHeader input.actionsInput') await page.fill('div.actionsHeader input.actionsInput', 'go to ') - await page.waitForTimeout(500) + await page.waitForTimeout(1000) + expect(await page.locator('div.selectPopup :text("Go To Applications")').count()).toBe(1) await page.click('div.selectPopup :text("Go To Applications")', { delay: 100 }) diff --git a/tests/sanity/tests/model/tracker/issues-details-page.ts b/tests/sanity/tests/model/tracker/issues-details-page.ts index 56a7a155ffc..7b780406f32 100644 --- a/tests/sanity/tests/model/tracker/issues-details-page.ts +++ b/tests/sanity/tests/model/tracker/issues-details-page.ts @@ -122,6 +122,6 @@ export class IssuesDetailsPage extends CommonTrackerPage { } async openSubIssueByName (issueName: string): Promise { - await this.page.locator('div.listGrid a', { hasText: issueName }).click() + await this.page.locator('div.main div.listGrid a', { hasText: issueName }).click() } } diff --git a/tests/sanity/tests/tracker/tracker.spec.ts b/tests/sanity/tests/tracker/tracker.spec.ts index 807895dc3e5..ca464bdf814 100644 --- a/tests/sanity/tests/tracker/tracker.spec.ts +++ b/tests/sanity/tests/tracker/tracker.spec.ts @@ -12,12 +12,13 @@ import { toTime } from './tracker.utils' import { TrackerNavigationMenuPage } from '../model/tracker/tracker-navigation-menu-page' +import { IssuesDetailsPage } from '../model/tracker/issues-details-page' test.use({ storageState: PlatformSetting }) -const getIssueName = (postfix: string = generateId(5)): string => `issue-${postfix}` +const getIssueName = (postfix: string = generateId()): string => `issue-${postfix}` const panelStatusMap = new Map([ ['Issues/All', DEFAULT_STATUSES], @@ -100,8 +101,10 @@ test.describe('Tracker tests', () => { await page.click('[data-id="tab-assigned"]') await expect(page.locator('.antiPanel-component')).not.toContainText(name) await page.click('[data-id="tab-created"]') + await page.waitForTimeout(3000) await expect(page.locator('.antiPanel-component')).toContainText(name) await page.click('[data-id="tab-subscribed"]') + await page.waitForTimeout(3000) await expect(page.locator('.antiPanel-component')).toContainText(name) await openIssue(page, name) // click "Don't track" @@ -219,7 +222,9 @@ test.describe('Tracker tests', () => { // We need to fait for indexer to complete indexing. await fillSearch(page, name) - await page.waitForSelector(`text="${name}"`, { timeout: 15000 }) + const issuesDetailsPage = new IssuesDetailsPage(page) + await issuesDetailsPage.waitDetailsOpened(name) + // await page.waitForSelector(`text="${name}"`, { timeout: 15000 }) let count = 0 for (let j = 0; j < 5; j++) {