Skip to content

Commit

Permalink
feat(tests): updated tests (#4209)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
  • Loading branch information
nestoragent authored Dec 16, 2023
1 parent d704f47 commit ec8a307
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
5 changes: 3 additions & 2 deletions tests/sanity/tests/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ test.describe('actions tests', () => {
await page.press('body', 'Meta+k')

await expect(page.locator('input.actionsInput')).toBeVisible()
await expect(page.locator('div.actionsitem div', { hasText: 'Merge contacts' })).toBeVisible()

await page.click('div.actionsHeader input.actionsInput')
await page.fill('div.actionsHeader input.actionsInput', 'go to ')
await page.waitForTimeout(500)

expect(await page.locator('div.selectPopup div.list-item :text("Go To Vacancies")').count()).toBe(1)
await page.click('div.selectPopup div.list-item :text("Go To Vacancies")', { delay: 100 })

Expand All @@ -57,10 +58,10 @@ test.describe('actions tests', () => {
await page.press('body', 'Meta+k')

await expect(page.locator('input.actionsInput')).toBeVisible()
await expect(page.locator('div.actionsitem div', { hasText: 'Merge contacts' })).toBeVisible()

await page.click('div.actionsHeader input.actionsInput')
await page.fill('div.actionsHeader input.actionsInput', 'go to ')
await page.waitForTimeout(500)
expect(await page.locator('div.selectPopup :text("Go To Applications")').count()).toBe(1)
await page.click('div.selectPopup :text("Go To Applications")', { delay: 100 })

Expand Down
5 changes: 1 addition & 4 deletions tests/sanity/tests/collaborative/applications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.describe('Collaborative tests for Application', () => {
await (await page.goto(`${PlatformURI}/workbench/sanity-ws/recruit`))?.finished()
})

test.skip('Add comment from several users', async ({ page, browser }) => {
test('Add comment from several users', async ({ page, browser }) => {
const vacancyName = 'Software Engineer'
let talentName: TalentName
// open second page
Expand All @@ -33,7 +33,6 @@ test.describe('Collaborative tests for Application', () => {
vacancy: vacancyName,
recruiterName: 'first'
})
await applicationsPage.selectType(vacancyName)
await applicationsPage.openApplicationByTalentName(talentName)

const applicationsDetailsPage = new ApplicationsDetailsPage(page)
Expand All @@ -60,7 +59,6 @@ test.describe('Collaborative tests for Application', () => {
await navigationMenuPageSecond.buttonApplications.click()

const applicationsPageSecond = new ApplicationsPage(userSecondPage)
await applicationsPageSecond.selectType(vacancyName)
await applicationsPageSecond.openApplicationByTalentName(talentName)

const applicationsDetailsPageSecond = new ApplicationsDetailsPage(userSecondPage)
Expand All @@ -85,7 +83,6 @@ test.describe('Collaborative tests for Application', () => {
await navigationMenuPage.buttonApplications.click()

const applicationsPage = new ApplicationsPage(page)
await applicationsPage.selectType(vacancyName)
await applicationsPage.openApplicationByTalentName(talentName)

const applicationsDetailsPage = new ApplicationsDetailsPage(page)
Expand Down
3 changes: 1 addition & 2 deletions tests/sanity/tests/contacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ test.describe('contact tests', () => {
button: 'right'
})
await page.click('text="Delete"')
// Click text=Yes
await page.click('text=Yes')
await page.click('form[id="view:string:DeleteObject"] button[type="submit"]')

await expect(page.locator(`td:has-text("${last} ${first}")`)).toHaveCount(0)
})
Expand Down
9 changes: 4 additions & 5 deletions tests/sanity/tests/model/recruiting/applications-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class ApplicationsPage extends CommonRecruitingPage {
readonly buttonCreateNewApplication: Locator
readonly buttonTabCreated: Locator
readonly textTableFirstCell: Locator
readonly buttonTypeSelector: Locator

constructor (page: Page) {
super(page)
Expand All @@ -25,6 +26,7 @@ export class ApplicationsPage extends CommonRecruitingPage {
this.buttonCreateNewApplication = page.locator('form[id="recruit:string:CreateApplication"] button[type="submit"]')
this.buttonTabCreated = page.locator('div[data-id="tab-created"]')
this.textTableFirstCell = page.locator('div[class$="firstCell"]')
this.buttonTypeSelector = page.locator('div[class*="header"] div[class*="title"] button')
}

async createNewApplication (data: NewApplication): Promise<void> {
Expand Down Expand Up @@ -102,10 +104,7 @@ export class ApplicationsPage extends CommonRecruitingPage {
}

async selectType (type: string): Promise<void> {
// await this.page
// .locator('div[class*=header]')
// .locator('div[class*=tablist-container]')
// .locator('div', { hasText: type })
// .click()
await this.buttonTypeSelector.click()
await this.selectMenuItem(this.page, type)
}
}
1 change: 0 additions & 1 deletion tests/sanity/tests/recruiting/applications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ test.describe('Application tests', () => {
vacancy: vacancyName,
recruiterName: 'first'
})
await applicationsPage.selectType(vacancyName)
await applicationsPage.openApplicationByTalentName(talentName)

const applicationsDetailsPage = new ApplicationsDetailsPage(page)
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/tests/recruiting/talents.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ test.describe('candidate/talents tests', () => {
await talentsPage.checkTalentNotExist(talentName)
})

test.skip('Merge contacts', async ({ page, context }) => {
test('Merge contacts', async ({ page, context }) => {
const navigationMenuPage = new NavigationMenuPage(page)
await navigationMenuPage.buttonTalents.click()
const talentsPage = new TalentsPage(page)
Expand Down

0 comments on commit ec8a307

Please sign in to comment.