mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-02 13:52:40 +00:00
TESTS-102: feat(tests): done Label filter test (#4885)
Signed-off-by: Alex Velichko <alex@hardcoreeng.com>
This commit is contained in:
parent
2abef8b6ec
commit
1ff82a9c15
@ -35,7 +35,7 @@ export class CommonPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkFromDropdown (page: Page, point: string): Promise<void> {
|
async checkFromDropdown (page: Page, point: string): Promise<void> {
|
||||||
await page.locator('div.selectPopup span[class^="lines"]', { hasText: point }).click()
|
await page.locator('div.selectPopup span[class^="lines"]', { hasText: point }).first().click()
|
||||||
}
|
}
|
||||||
|
|
||||||
async pressYesDeletePopup (page: Page): Promise<void> {
|
async pressYesDeletePopup (page: Page): Promise<void> {
|
||||||
|
@ -53,12 +53,17 @@ export class CommonTrackerPage extends CalendarPage {
|
|||||||
await this.buttonFilter.click()
|
await this.buttonFilter.click()
|
||||||
await this.page.locator('div.selectPopup [class*="menu"]', { hasText: filter }).click()
|
await this.page.locator('div.selectPopup [class*="menu"]', { hasText: filter }).click()
|
||||||
|
|
||||||
if (filterSecondLevel !== null) {
|
if (filterSecondLevel !== null && typeof filterSecondLevel === 'string') {
|
||||||
if (filter === 'Title') {
|
switch (filter) {
|
||||||
await this.inputFilterTitle.fill(filterSecondLevel)
|
case 'Title':
|
||||||
await this.buttonFilterApply.click()
|
await this.inputFilterTitle.fill(filterSecondLevel)
|
||||||
} else {
|
await this.buttonFilterApply.click()
|
||||||
await this.page.locator('div.selectPopup [class*="menu"]', { hasText: filterSecondLevel }).click()
|
break
|
||||||
|
case 'Labels':
|
||||||
|
await this.selectFromDropdown(this.page, filterSecondLevel)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
await this.page.locator('div.selectPopup [class*="menu"]', { hasText: filterSecondLevel }).click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,4 +401,31 @@ test.describe('Tracker filters tests', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('Label filter', async ({ page }) => {
|
||||||
|
const filterLabel = 'Filter Label'
|
||||||
|
const labelIssue: NewIssue = {
|
||||||
|
title: `Issue for the Label filter-${generateId()}`,
|
||||||
|
description: 'Issue for the Label filter',
|
||||||
|
labels: filterLabel,
|
||||||
|
createLabel: true
|
||||||
|
}
|
||||||
|
|
||||||
|
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||||
|
await leftSideMenuPage.buttonTracker.click()
|
||||||
|
|
||||||
|
const issuesPage = new IssuesPage(page)
|
||||||
|
await issuesPage.modelSelectorAll.click()
|
||||||
|
await issuesPage.createNewIssue(labelIssue)
|
||||||
|
|
||||||
|
await test.step('Check Label filter for exist Label', async () => {
|
||||||
|
await issuesPage.selectFilter('Labels', filterLabel)
|
||||||
|
await issuesPage.inputSearch.press('Escape')
|
||||||
|
await issuesPage.checkFilter('Labels', 'is', filterLabel)
|
||||||
|
|
||||||
|
for await (const issue of iterateLocator(issuesPage.issuesList)) {
|
||||||
|
await expect(issue.locator('div.compression-bar > div.label-box span.label')).toContainText(filterLabel)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user