mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-26 04:23:58 +03:00
feat(tests): TESTS-166 done Check Contact activity backlink test (#4585)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
parent
18043e1c91
commit
48c83d8063
22
tests/sanity/tests/model/contacts/employee-details-page.ts
Normal file
22
tests/sanity/tests/model/contacts/employee-details-page.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { expect, type Locator, type Page } from '@playwright/test'
|
||||
import { CommonPage } from '../common-page'
|
||||
|
||||
export class EmployeeDetailsPage extends CommonPage {
|
||||
readonly page: Page
|
||||
readonly pageHeader: Locator
|
||||
readonly textActivity: Locator
|
||||
readonly textActivityContent: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
super()
|
||||
this.page = page
|
||||
this.pageHeader = page.locator('span[class$="title"]', { hasText: 'Employee' })
|
||||
this.textActivity = page.locator('div.header')
|
||||
this.textActivityContent = page.locator('div.activityMessage div.content div[class*="content"]')
|
||||
}
|
||||
|
||||
async checkActivityExist (activityHeader: string, activityContent: string): Promise<void> {
|
||||
await expect(this.textActivity.filter({ hasText: activityHeader }).first()).toBeVisible()
|
||||
await expect(this.textActivityContent.filter({ hasText: activityContent }).first()).toBeVisible()
|
||||
}
|
||||
}
|
17
tests/sanity/tests/model/contacts/employees-page.ts
Normal file
17
tests/sanity/tests/model/contacts/employees-page.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { type Locator, type Page } from '@playwright/test'
|
||||
import { CommonPage } from '../common-page'
|
||||
|
||||
export class EmployeesPage extends CommonPage {
|
||||
readonly page: Page
|
||||
readonly pageHeader: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
super()
|
||||
this.page = page
|
||||
this.pageHeader = page.locator('span[class$="title"]', { hasText: 'Employee' })
|
||||
}
|
||||
|
||||
async openEmployeeByName (employeeName: string): Promise<void> {
|
||||
await this.page.locator('tr a', { hasText: employeeName }).click()
|
||||
}
|
||||
}
|
11
tests/sanity/tests/model/contacts/navigation-menu-page.ts
Normal file
11
tests/sanity/tests/model/contacts/navigation-menu-page.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { type Locator, type Page } from '@playwright/test'
|
||||
|
||||
export class ContactsNavigationMenuPage {
|
||||
readonly page: Page
|
||||
readonly buttonEmployee: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
this.page = page
|
||||
this.buttonEmployee = page.locator('a[href$="employees"]', { hasText: 'Employee' })
|
||||
}
|
||||
}
|
@ -5,6 +5,9 @@ import { IssuesPage } from '../model/tracker/issues-page'
|
||||
import { IssuesDetailsPage } from '../model/tracker/issues-details-page'
|
||||
import { NewIssue } from '../model/tracker/types'
|
||||
import { allure } from 'allure-playwright'
|
||||
import { ContactsNavigationMenuPage } from '../model/contacts/navigation-menu-page'
|
||||
import { EmployeesPage } from '../model/contacts/employees-page'
|
||||
import { EmployeeDetailsPage } from '../model/contacts/employee-details-page'
|
||||
|
||||
test.use({
|
||||
storageState: PlatformSetting
|
||||
@ -66,4 +69,36 @@ test.describe('Mentions issue tests', () => {
|
||||
await issuesDetailsPage.checkCollaboratorsCount('2 members')
|
||||
await issuesDetailsPage.checkCollaborators(['Appleseed John', 'Dirak Kainin'])
|
||||
})
|
||||
|
||||
test('Check that the backlink shown in the Contact activity', async ({ page }) => {
|
||||
const mentionName = 'Dirak Kainin'
|
||||
const mentionIssue: NewIssue = {
|
||||
title: `Check that the backlink shown in the Contact activity-${generateId()}`,
|
||||
description: 'Check that the backlink shown in the Contact activity description'
|
||||
}
|
||||
|
||||
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||
await leftSideMenuPage.buttonTracker.click()
|
||||
|
||||
const issuesPage = new IssuesPage(page)
|
||||
await issuesPage.modelSelectorAll.click()
|
||||
await issuesPage.createNewIssue(mentionIssue)
|
||||
await issuesPage.searchIssueByName(mentionIssue.title)
|
||||
await issuesPage.openIssueByName(mentionIssue.title)
|
||||
|
||||
const issuesDetailsPage = new IssuesDetailsPage(page)
|
||||
await issuesDetailsPage.addMentions(mentionName)
|
||||
await issuesDetailsPage.checkCommentExist(`@${mentionName}`)
|
||||
|
||||
await leftSideMenuPage.buttonContacts.click()
|
||||
|
||||
const contactsNavigationMenuPage = new ContactsNavigationMenuPage(page)
|
||||
await contactsNavigationMenuPage.buttonEmployee.click()
|
||||
|
||||
const employeesPage = new EmployeesPage(page)
|
||||
await employeesPage.openEmployeeByName(mentionName)
|
||||
|
||||
const employeeDetailsPage = new EmployeeDetailsPage(page)
|
||||
await employeeDetailsPage.checkActivityExist(`mentioned ${mentionName} in`, `@${mentionName}`)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user