Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tests): updated flaky tests #4218

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/sanity/tests/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
haiodo marked this conversation as resolved.
Show resolved Hide resolved

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 })
Expand All @@ -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 })

Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/tests/model/tracker/issues-details-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ export class IssuesDetailsPage extends CommonTrackerPage {
}

async openSubIssueByName (issueName: string): Promise<void> {
await this.page.locator('div.listGrid a', { hasText: issueName }).click()
await this.page.locator('div.main div.listGrid a', { hasText: issueName }).click()
}
}
8 changes: 6 additions & 2 deletions tests/sanity/tests/tracker/tracker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -219,7 +222,8 @@ 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)

let count = 0
for (let j = 0; j < 5; j++) {
Expand Down