feat(tests): TESTS-106 (#4217)

Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
Alex Velichko 2023-12-19 09:13:10 +03:00 committed by GitHub
parent a82ef5aa94
commit 20fda19cf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 1 deletions

View File

@ -10,7 +10,7 @@ export class ApplicationsDetailsPage extends CommonRecruitingPage {
constructor (page: Page) {
super(page)
this.page = page
this.textApplicationId = page.locator('div.popupPanel-title div.title.not-active')
this.textApplicationId = page.locator('div.popupPanel-title div.title:last-child')
this.buttonState = page
.locator('div[class*="collapsed-container"]')
.nth(0)
@ -43,4 +43,8 @@ export class ApplicationsDetailsPage extends CommonRecruitingPage {
}
await this.buttonSelectCollaborators.press('Escape')
}
async waitApplicationDetailsOpened (applicationId: string): Promise<void> {
await expect(this.textApplicationId).toHaveText(applicationId)
}
}

View File

@ -116,4 +116,11 @@ export class TalentDetailsPage extends CommonRecruitingPage {
await this.buttonPopupMergeContacts.click()
}
async waitTalentDetailsOpened (applicationFirstName: string, applicationLastName?: string): Promise<void> {
await this.page.waitForSelector(`div[class*="header"] div.name:first-child :has-text("${applicationFirstName}")`)
if (applicationLastName != null) {
await this.page.waitForSelector(`div[class*="header"] div.name:nth-child(2) :has-text("${applicationFirstName}")`)
}
}
}

View File

@ -159,4 +159,28 @@ test.describe('Application tests', () => {
applicationsDetailsPage = new ApplicationsDetailsPage(page)
await applicationsDetailsPage.changeState('Offer')
})
test('Comment stored after reload the page', async ({ page }) => {
const commentText = `Application comment should be stored after reload-${generateId()}`
const vacancyName = 'Software Engineer'
const navigationMenuPage = new NavigationMenuPage(page)
await navigationMenuPage.buttonApplications.click()
const applicationsPage = new ApplicationsPage(page)
const talentName = await applicationsPage.createNewApplicationWithNewTalent({
vacancy: vacancyName,
recruiterName: 'first'
})
await applicationsPage.openApplicationByTalentName(talentName)
const applicationsDetailsPage = new ApplicationsDetailsPage(page)
const applicationId = await applicationsDetailsPage.getApplicationId()
await applicationsDetailsPage.addComment(commentText)
await applicationsDetailsPage.checkCommentExist(commentText)
await page.reload()
await applicationsDetailsPage.waitApplicationDetailsOpened(applicationId)
await applicationsDetailsPage.checkCommentExist(commentText)
})
})