Skip to content

Commit

Permalink
TESTS-179: feat(tests): done Check the changed description activity t…
Browse files Browse the repository at this point in the history
…est (#4598)

Signed-off-by: Alex Velichko <alex@hardcoreeng.com>
  • Loading branch information
nestoragent authored Feb 12, 2024
1 parent 318f4ea commit 597caba
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/sanity/tests/model/tracker/issues-details-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,17 @@ export class IssuesDetailsPage extends CommonTrackerPage {
async checkCollaboratorsCount (count: string): Promise<void> {
await expect(this.buttonCollaborators).toHaveText(count)
}

async addToDescription (description: string): Promise<void> {
const existDescription = await this.inputDescription.textContent()
await this.inputDescription.fill(`${existDescription}\n${description}`)
}

async openShowMoreLink (activityHeader: string, position: number = 0): Promise<void> {
await this.textActivity.filter({ hasText: activityHeader }).locator('xpath=..').locator('div.showMore').click()
}

async checkComparingTextAdded (text: string): Promise<void> {
await expect(this.page.locator('span.text-editor-highlighted-node-add', { hasText: text }).first()).toBeVisible()
}
}
24 changes: 24 additions & 0 deletions tests/sanity/tests/tracker/issues.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,28 @@ test.describe('Tracker issue tests', () => {
await issuesPage.searchIssueByName(deleteIssue.title)
await issuesPage.checkIssueNotExist(deleteIssue.title)
})

test('Check the changed description activity', async ({ page }) => {
const additionalDescription = 'New row for the additional description'
const changedDescriptionIssue: NewIssue = {
title: `Check the changed description activity-${generateId()}`,
description: 'Check the changed description activity description'
}

const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()

const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll.click()
await issuesPage.createNewIssue(changedDescriptionIssue)
await issuesPage.searchIssueByName(changedDescriptionIssue.title)
await issuesPage.openIssueByName(changedDescriptionIssue.title)

const issuesDetailsPage = new IssuesDetailsPage(page)
await issuesDetailsPage.waitDetailsOpened(changedDescriptionIssue.title)
await issuesDetailsPage.checkIssue(changedDescriptionIssue)
await issuesDetailsPage.addToDescription(additionalDescription)
await issuesDetailsPage.openShowMoreLink('changed description')
await issuesDetailsPage.checkComparingTextAdded(additionalDescription)
})
})

0 comments on commit 597caba

Please sign in to comment.