mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03: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> {
|
||||
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> {
|
||||
|
@ -53,12 +53,17 @@ export class CommonTrackerPage extends CalendarPage {
|
||||
await this.buttonFilter.click()
|
||||
await this.page.locator('div.selectPopup [class*="menu"]', { hasText: filter }).click()
|
||||
|
||||
if (filterSecondLevel !== null) {
|
||||
if (filter === 'Title') {
|
||||
await this.inputFilterTitle.fill(filterSecondLevel)
|
||||
await this.buttonFilterApply.click()
|
||||
} else {
|
||||
await this.page.locator('div.selectPopup [class*="menu"]', { hasText: filterSecondLevel }).click()
|
||||
if (filterSecondLevel !== null && typeof filterSecondLevel === 'string') {
|
||||
switch (filter) {
|
||||
case 'Title':
|
||||
await this.inputFilterTitle.fill(filterSecondLevel)
|
||||
await this.buttonFilterApply.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