TESTS-102: feat(tests): done Label filter test (#4885)

Signed-off-by: Alex Velichko <alex@hardcoreeng.com>
This commit is contained in:
Alex Velichko 2024-03-08 22:13:33 +03:00 committed by GitHub
parent 2abef8b6ec
commit 1ff82a9c15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 39 additions and 7 deletions

View File

@ -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> {

View File

@ -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()
}
}
}

View File

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