Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ export class ApplicationsDetailsPage extends CommonRecruitingPage {
return applicationId != null ? applicationId : ''
}

async deleteApplication (): Promise<void> {
await this.buttonMoreActions.click()
await this.buttonDelete.click()
await this.pressYesDeletePopup(this.page)
}

async changeState (status: string): Promise<void> {
await this.buttonState.click()
await this.selectFromDropdown(this.page, status)
Expand Down
6 changes: 3 additions & 3 deletions tests/sanity/tests/model/recruiting/applications-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class ApplicationsPage extends CommonRecruitingPage {

async checkApplicationDoneStatus (talentName: TalentName, done: string): Promise<void> {
await expect(
await this.page
this.page
.locator('tr', { hasText: `${talentName.lastName} ${talentName.firstName}` })
.locator('td')
.nth(6)
Expand All @@ -90,15 +90,15 @@ export class ApplicationsPage extends CommonRecruitingPage {

async checkApplicationState (talentName: TalentName, done: string): Promise<void> {
await expect(
await this.page
this.page
.locator('tr', { hasText: `${talentName.lastName} ${talentName.firstName}` })
.locator('td')
.nth(5)
).toHaveText(done)
}

async checkApplicationNotExist (applicationId: string): Promise<void> {
await expect(await this.textTableFirstCell.filter({ hasText: applicationId })).toHaveCount(0)
await expect(this.textTableFirstCell.filter({ hasText: applicationId })).toHaveCount(0)
}

async changeApplicationStatus (talentName: TalentName, status: string): Promise<void> {
Expand Down
8 changes: 7 additions & 1 deletion tests/sanity/tests/model/recruiting/talents-page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Locator, type Page } from '@playwright/test'
import { expect, type Locator, type Page } from '@playwright/test'
import { TalentName } from './types'
import { generateId } from '../../utils'
import { CommonRecruitingPage } from './common-recruiting-page'
Expand All @@ -7,12 +7,14 @@ export class TalentsPage extends CommonRecruitingPage {
readonly page: Page
readonly pageHeader: Locator
readonly buttonCreateTalent: Locator
readonly textTableFirstCell: Locator

constructor (page: Page) {
super(page)
this.page = page
this.pageHeader = page.locator('span[class*="header"]', { hasText: 'Talents' })
this.buttonCreateTalent = page.locator('div[class*="ac-header"] button > span', { hasText: 'Talent' })
this.textTableFirstCell = page.locator('div[class$="firstCell"]')
}

async createNewTalent (): Promise<TalentName> {
Expand All @@ -31,4 +33,8 @@ export class TalentsPage extends CommonRecruitingPage {
.locator('div[class$="firstCell"]')
.click()
}

async checkTalentNotExist (talentName: TalentName): Promise<void> {
await expect(this.page.locator('tr', { hasText: `${talentName.lastName} ${talentName.firstName}` })).toHaveCount(0)
}
}
2 changes: 1 addition & 1 deletion tests/sanity/tests/recruiting/applications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ test.describe('Application tests', () => {
const applicationsDetailsPage = new ApplicationsDetailsPage(page)
const applicationId = await applicationsDetailsPage.getApplicationId()

await applicationsDetailsPage.deleteApplication()
await applicationsDetailsPage.deleteEntity()
expect(page.url()).toContain(applicationId)

await navigationMenuPage.buttonApplications.click()
Expand Down
16 changes: 16 additions & 0 deletions tests/sanity/tests/recruiting/talents.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,20 @@ test.describe('candidate/talents tests', () => {
const title = `Title-${generateId(4)}`
await talentDetailsPage.addTitle(title)
})

test('Delete the Talent', async ({ page, context }) => {
const navigationMenuPage = new NavigationMenuPage(page)
await navigationMenuPage.buttonTalents.click()

const talentsPage = new TalentsPage(page)
const talentName = await talentsPage.createNewTalent()
await talentsPage.openTalentByTalentName(talentName)

const talentDetailsPage = new TalentDetailsPage(page)
await talentDetailsPage.inputLocation.fill('Awesome Location')
await talentDetailsPage.deleteEntity()

await navigationMenuPage.buttonTalents.click()
await talentsPage.checkTalentNotExist(talentName)
})
})