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

TESTS-97: feat(tests): done the Priority filter test #4156

Merged
merged 4 commits into from
Dec 7, 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/sanity-ws/000001/space-1701802298347-0.snp.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/sanity-ws/000001/task-1701802298347-0.snp.gz
Binary file not shown.
Binary file added tests/sanity-ws/000001/task-1701887454134-0.snp.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/sanity-ws/000001/tx-1701802298347-0.snp.gz
Binary file not shown.
Binary file added tests/sanity-ws/000001/tx-1701887454134-0.snp.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/sanity-ws/backup.json.gz
Binary file not shown.
6 changes: 4 additions & 2 deletions tests/sanity/tests/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ test.describe('actions tests', () => {

await page.click('text=Talents')
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/talents`)
await expect(page.locator('a[href$="talents"] > div.selected')).toBeVisible()

await page.press('body', 'Meta+k')

await expect(page.locator('input.actionsInput')).toBeVisible()
await expect(page.locator('div.actionsitem div', { hasText: 'Merge contacts' })).toBeVisible()

await page.click('div.actionsHeader input.actionsInput')
await page.type('div.actionsHeader input.actionsInput', 'go to ')
await page.fill('div.actionsHeader input.actionsInput', 'go to ')
expect(await page.locator('div.selectPopup :text("Go To Vacancies")').count()).toBe(1)
await page.click('div.selectPopup :text("Go To Vacancies")')

Expand All @@ -51,14 +52,15 @@ test.describe('actions tests', () => {

await page.click('text=Talents')
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/talents`)
await expect(page.locator('a[href$="talents"] > div.selected')).toBeVisible()

await page.press('body', 'Meta+k')

await expect(page.locator('input.actionsInput')).toBeVisible()
await expect(page.locator('div.actionsitem div', { hasText: 'Merge contacts' })).toBeVisible()

await page.click('div.actionsHeader input.actionsInput')
await page.type('div.actionsHeader input.actionsInput', 'go to ')
await page.fill('div.actionsHeader input.actionsInput', 'go to ')
expect(await page.locator('div.selectPopup :text("Go To Applications")').count()).toBe(1)
await page.click('div.selectPopup :text("Go To Applications")')

Expand Down
7 changes: 7 additions & 0 deletions tests/sanity/tests/model/tracker/issues-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,11 @@ export class IssuesPage extends CommonTrackerPage {
await expect(locator.locator('div[class*="square"] > svg')).toHaveAttribute('id', statusId)
}
}

async checkAllIssuesByPriority (priorityName: string): Promise<void> {
for await (const locator of iterateLocator(this.page.locator('div.listGrid'))) {
const href = await locator.locator('div.priority-container use').getAttribute('href')
expect(href).toContain(priorityName)
}
}
}
21 changes: 20 additions & 1 deletion tests/sanity/tests/tracker/filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { LeftSideMenuPage } from '../model/left-side-menu-page'
import { IssuesPage } from '../model/tracker/issues-page'
import { NewIssue } from '../model/tracker/types'
import { allure } from 'allure-playwright'
import { DEFAULT_STATUSES, DEFAULT_STATUSES_ID } from './tracker.utils'
import { DEFAULT_STATUSES, DEFAULT_STATUSES_ID, PRIORITIES } from './tracker.utils'

test.use({
storageState: PlatformSetting
Expand Down Expand Up @@ -224,4 +224,23 @@ test.describe('Tracker filters tests', () => {
})
}
})

test('Priority filter', async ({ page }) => {
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()

const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll.click()

for (const priority of PRIORITIES) {
await test.step(`Priority Filter ${priority}`, async () => {
await issuesPage.selectFilter('Priority', priority)
await issuesPage.inputSearch.press('Escape')

await issuesPage.checkFilter('Priority', 'is')
await issuesPage.checkAllIssuesByPriority(priority.toLowerCase().replaceAll(' ', ''))
await issuesPage.buttonClearFilers.click()
})
}
})
})