TESTS-101: feat(tests): done Modified by filter test (#4871)

Signed-off-by: Alex Velichko <alex@hardcoreeng.com>
This commit is contained in:
Alex Velichko 2024-03-06 18:37:37 +03:00 committed by GitHub
parent b155bf0e53
commit 049c3125b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 1 deletions

View File

@ -22,6 +22,7 @@ export class CommonTrackerPage extends CalendarPage {
readonly inputFilterTitle: Locator
readonly buttonFilterApply: Locator
readonly buttonClearFilters: Locator
readonly textCategoryHeader: Locator
constructor (page: Page) {
super(page)
@ -45,6 +46,7 @@ export class CommonTrackerPage extends CalendarPage {
this.inputFilterTitle = page.locator('div.selectPopup input[placeholder="Title"]')
this.buttonFilterApply = page.locator('div.selectPopup button[type="button"]', { hasText: 'Apply' })
this.buttonClearFilters = page.locator('button > span', { hasText: 'Clear filters' })
this.textCategoryHeader = page.locator('div.category-container > div.categoryHeader span[class*="label"]')
}
async selectFilter (filter: string, filterSecondLevel?: string): Promise<void> {
@ -206,4 +208,8 @@ export class CommonTrackerPage extends CalendarPage {
const srcset = await this.commentImg.getAttribute('srcset')
expect(srcset).toContain(fileName)
}
async checkCategoryHeader (categoryHeader: string): Promise<void> {
await expect(this.textCategoryHeader).toHaveText(categoryHeader)
}
}

View File

@ -41,7 +41,7 @@ export class IssuesDetailsPage extends CommonTrackerPage {
this.buttonMilestone = page.locator('//span[text()="Milestone"]/following-sibling::div[1]/div/button')
this.textEstimation = page.locator('//span[text()="Estimation"]/following-sibling::div[1]/button/span')
this.buttonEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[3]')
this.buttonCreatedBy = page.locator('(//span[text()="Assignee"]/../div/button)[1]')
this.buttonCreatedBy = page.locator('//span[text()="Created by"]/following-sibling::div[1]/button')
this.buttonCloseIssue = page.locator('#btnPClose')
this.textParentTitle = page.locator('span.issue-title')
this.buttonAddSubIssue = page.locator('#add-sub-issue')

View File

@ -337,4 +337,26 @@ test.describe('Tracker filters tests', () => {
}
})
})
test('Modified by filter', async ({ page }) => {
const modifierName = 'Appleseed John'
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll.click()
await issuesPage.selectFilter('Modified by', modifierName)
await issuesPage.inputSearch.press('Escape')
await issuesPage.checkFilter('Modified by', 'is')
for await (const issue of iterateLocator(issuesPage.issuesList)) {
await issue.locator('span.list > a').click()
const issuesDetailsPage = new IssuesDetailsPage(page)
await expect(issuesDetailsPage.buttonCreatedBy).toHaveText(modifierName)
await issuesDetailsPage.buttonCloseIssue.click()
}
})
})