Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/sanity/tests/model/tracker/common-tracker-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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> {
Expand Down Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion tests/sanity/tests/model/tracker/issues-details-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
22 changes: 22 additions & 0 deletions tests/sanity/tests/tracker/filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
})
})