diff --git a/tests/sanity/tests/model/recruiting/applications-details-page.ts b/tests/sanity/tests/model/recruiting/applications-details-page.ts index 55135ee349..ce327fb92f 100644 --- a/tests/sanity/tests/model/recruiting/applications-details-page.ts +++ b/tests/sanity/tests/model/recruiting/applications-details-page.ts @@ -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 { + await expect(this.textApplicationId).toHaveText(applicationId) + } } diff --git a/tests/sanity/tests/model/recruiting/talent-details-page.ts b/tests/sanity/tests/model/recruiting/talent-details-page.ts index 19b6225597..5be7f4aae5 100644 --- a/tests/sanity/tests/model/recruiting/talent-details-page.ts +++ b/tests/sanity/tests/model/recruiting/talent-details-page.ts @@ -116,4 +116,11 @@ export class TalentDetailsPage extends CommonRecruitingPage { await this.buttonPopupMergeContacts.click() } + + async waitTalentDetailsOpened (applicationFirstName: string, applicationLastName?: string): Promise { + 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}")`) + } + } } diff --git a/tests/sanity/tests/recruiting/applications.spec.ts b/tests/sanity/tests/recruiting/applications.spec.ts index b4819770ae..a24cff2fd3 100644 --- a/tests/sanity/tests/recruiting/applications.spec.ts +++ b/tests/sanity/tests/recruiting/applications.spec.ts @@ -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) + }) })