feat(tests): update Merge contacts test (#4339)

Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
Alex Velichko 2024-01-10 20:49:24 +03:00 committed by GitHub
parent 9164790d8f
commit 19a456eeb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,7 @@ export class TalentsPage extends CommonRecruitingPage {
readonly buttonCreateTalent: Locator
readonly textVacancyMatchingTalent: Locator
readonly textVacancyMatchingScore: Locator
readonly inputSearchTalent: Locator
constructor (page: Page) {
super(page)
@ -21,6 +22,7 @@ export class TalentsPage extends CommonRecruitingPage {
this.textVacancyMatchingScore = page.locator(
'form[id="recruit:string:VacancyMatching"] table > tbody > tr > td:nth-child(2)'
)
this.inputSearchTalent = page.locator('div[class*="header"] input')
}
async createNewTalent (): Promise<TalentName> {
@ -40,7 +42,7 @@ export class TalentsPage extends CommonRecruitingPage {
async openTalentByTalentName (talentName: TalentName): Promise<void> {
await this.page
.locator('tr', { hasText: `${talentName.lastName} ${talentName.firstName}` })
.locator('div[class$="firstCell"]')
.locator('a.noOverflow')
.click()
}
@ -59,4 +61,11 @@ export class TalentsPage extends CommonRecruitingPage {
await expect(this.textVacancyMatchingTalent).toContainText(talentName, { ignoreCase: true })
await expect(this.textVacancyMatchingScore).toContainText(score)
}
async searchTalentByTalentName (talentName: TalentName): Promise<void> {
await this.inputSearchTalent.fill(`${talentName.lastName} ${talentName.firstName}`)
await this.inputSearchTalent.press('Enter')
await expect(this.page.locator('tr', { hasText: `${talentName.lastName} ${talentName.firstName}` })).toBeVisible()
}
}

View File

@ -156,6 +156,7 @@ test.describe('candidate/talents tests', () => {
})
await navigationMenuPage.buttonTalents.click()
await talentsPage.searchTalentByTalentName(talentNameFirst)
await talentsPage.openTalentByTalentName(talentNameFirst)
await talentDetailsPage.checkSocialLinks('Phone', '123123213213')
await talentDetailsPage.checkSocialLinks('Email', 'test-merge-2@gmail.com')