Fix locator for flaky test (#5524)

* Update talents-page.ts

Signed-off-by: Jasmin <jasmin@hardcoreeng.com>

* Update talents-page.ts

Signed-off-by: Jasmin <jasmin@hardcoreeng.com>

---------

Signed-off-by: Jasmin <jasmin@hardcoreeng.com>
This commit is contained in:
JasminMus 2024-05-07 09:15:12 +02:00 committed by GitHub
parent 9d47b22a17
commit 6c2fdb520b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,6 +59,8 @@ export class TalentsPage extends CommonRecruitingPage {
openOtherSkills = (): Locator => this.page.getByText('Other')
skillsLink = (): Locator => this.page.locator('text=Skills')
newSkillButton = (): Locator => this.page.locator('button:has-text("Skill")')
emailContact = (): Locator =>
this.page.locator('div[class^="popupPanel-body__header"] button[id="gmail:string:Email"]')
async clickAddApplication (): Promise<void> {
await this.addApplicationButton().click()
@ -170,9 +172,7 @@ export class TalentsPage extends CommonRecruitingPage {
}
async verifyEmailInPopup (email: string): Promise<void> {
const emailLocator = this.popupPanel().locator('[id="gmail\\:string\\:Email"]')
await emailLocator.scrollIntoViewIfNeeded()
await emailLocator.click()
await this.emailContact().click()
const actualEmail = await this.page.locator('.cover-channel >> input').inputValue()
expect(actualEmail).toEqual(email)
}