mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +00:00
feat(tests): Added Change & Save all States test (#3863)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
parent
dfbd48cc7a
commit
26f533bc88
@ -14,6 +14,7 @@ export class ApplicationsDetailsPage extends CommonPage {
|
||||
readonly textApplicationId: Locator
|
||||
readonly buttonMoreActions: Locator
|
||||
readonly buttonDelete: Locator
|
||||
readonly buttonState: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
super()
|
||||
@ -28,6 +29,10 @@ export class ApplicationsDetailsPage extends CommonPage {
|
||||
this.textApplicationId = page.locator('div.popupPanel-title div.title-wrapper > span')
|
||||
this.buttonMoreActions = page.locator('div.popupPanel-title div.buttons-group > button:nth-of-type(2)')
|
||||
this.buttonDelete = page.locator('button[class*="menuItem"] span', { hasText: 'Delete' })
|
||||
this.buttonState = page
|
||||
.locator('div[class*="collapsed-container"]')
|
||||
.nth(0)
|
||||
.locator('div[class*="aside-grid"] > div:nth-of-type(1) > button')
|
||||
}
|
||||
|
||||
async addComment (comment: string): Promise<void> {
|
||||
@ -56,7 +61,7 @@ export class ApplicationsDetailsPage extends CommonPage {
|
||||
|
||||
async getApplicationId (): Promise<string> {
|
||||
const applicationId = await this.textApplicationId.textContent()
|
||||
expect(applicationId !== null).toBeTruthy()
|
||||
await expect(applicationId !== null).toBeTruthy()
|
||||
return applicationId != null ? applicationId : ''
|
||||
}
|
||||
|
||||
@ -65,4 +70,10 @@ export class ApplicationsDetailsPage extends CommonPage {
|
||||
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)
|
||||
await expect(await this.buttonState).toContainText(status)
|
||||
}
|
||||
}
|
||||
|
@ -74,8 +74,7 @@ export class ApplicationsPage extends CommonPage {
|
||||
|
||||
async openApplicationByTalentName (talentName: TalentName): Promise<void> {
|
||||
await this.page
|
||||
.locator('span.ap-label', { hasText: `${talentName.lastName} ${talentName.firstName}` })
|
||||
.locator('xpath=../../../../..')
|
||||
.locator('tr', { hasText: `${talentName.lastName} ${talentName.firstName}` })
|
||||
.locator('div[class*="firstCell"]')
|
||||
.click()
|
||||
}
|
||||
@ -83,14 +82,31 @@ export class ApplicationsPage extends CommonPage {
|
||||
async checkApplicationDoneStatus (talentName: TalentName, done: string): Promise<void> {
|
||||
await expect(
|
||||
await this.page
|
||||
.locator('span.ap-label', { hasText: `${talentName.lastName} ${talentName.firstName}` })
|
||||
.locator('xpath=../../../../..')
|
||||
.locator('tr', { hasText: `${talentName.lastName} ${talentName.firstName}` })
|
||||
.locator('td')
|
||||
.nth(6)
|
||||
).toHaveText(done)
|
||||
}
|
||||
|
||||
async checkApplicationState (talentName: TalentName, done: string): Promise<void> {
|
||||
await expect(
|
||||
await 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)
|
||||
}
|
||||
|
||||
async changeApplicationStatus (talentName: TalentName, status: string): Promise<void> {
|
||||
await this.page
|
||||
.locator('tr', { hasText: `${talentName.lastName} ${talentName.firstName}` })
|
||||
.locator('td')
|
||||
.nth(5)
|
||||
.click()
|
||||
await this.selectFromDropdown(this.page, status)
|
||||
}
|
||||
}
|
||||
|
@ -128,4 +128,29 @@ test.describe('Application tests', () => {
|
||||
await navigationMenuPage.buttonApplications.click()
|
||||
await applicationsPage.checkApplicationNotExist(applicationId)
|
||||
})
|
||||
|
||||
test('Change & Save all States', async ({ page }) => {
|
||||
const navigationMenuPage = new NavigationMenuPage(page)
|
||||
await navigationMenuPage.buttonApplications.click()
|
||||
|
||||
const applicationsPage = new ApplicationsPage(page)
|
||||
const talentName = await applicationsPage.createNewApplicationWithNewTalent({
|
||||
vacancy: 'first',
|
||||
recruiterName: 'first'
|
||||
})
|
||||
await applicationsPage.checkApplicationState(talentName, 'HR Interview')
|
||||
await applicationsPage.openApplicationByTalentName(talentName)
|
||||
|
||||
let applicationsDetailsPage = new ApplicationsDetailsPage(page)
|
||||
await applicationsDetailsPage.changeState('Technical Interview')
|
||||
|
||||
await navigationMenuPage.buttonApplications.click()
|
||||
await applicationsPage.checkApplicationState(talentName, 'Technical Interview')
|
||||
await applicationsPage.changeApplicationStatus(talentName, 'Test task')
|
||||
await applicationsPage.checkApplicationState(talentName, 'Test task')
|
||||
|
||||
await applicationsPage.openApplicationByTalentName(talentName)
|
||||
applicationsDetailsPage = new ApplicationsDetailsPage(page)
|
||||
await applicationsDetailsPage.changeState('Offer')
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user