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

Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
Alex Velichko
2023-12-07 14:26:53 +07:00
committed by GitHub
parent 3df1f1d6df
commit e540913376
63 changed files with 31 additions and 3 deletions
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.
+4 -2
View File
@@ -32,6 +32,7 @@ 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')
@@ -39,7 +40,7 @@ test.describe('actions tests', () => {
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")')
@@ -51,6 +52,7 @@ 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')
@@ -58,7 +60,7 @@ test.describe('actions tests', () => {
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")')
@@ -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)
}
}
}
+20 -1
View File
@@ -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
@@ -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()
})
}
})
})