platform/tests/sanity/tests/actions.spec.ts
Alex Velichko e540913376
TESTS-97: feat(tests): done the Priority filter test (#4156)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
2023-12-07 14:26:53 +07:00

70 lines
2.8 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { PlatformSetting, PlatformURI } from './utils'
import { allure } from 'allure-playwright'
test.use({
storageState: PlatformSetting
})
test.describe('actions tests', () => {
test.beforeEach(async ({ page }) => {
await allure.parentSuite('Actions tests')
await (await page.goto(`${PlatformURI}/workbench/sanity-ws/sanity-ws`))?.finished()
})
test('action-new-candidate', async ({ page }) => {
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
await page.click('text=Talents')
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/talents`)
await page.click('td:has-text("Frontend Engineer")')
await page.press('body', 'Meta+k')
await page.fill('[placeholder="Search\\ or\\ run\\ a\\ command\\.\\.\\."]', 'Talent')
expect(await page.locator('div.selectPopup :text("New Talent")').count()).toBe(1)
await page.click('div.selectPopup :text("New Talent")')
await page.click('button#card-close')
})
test('action-switch-vacancies', async ({ page }) => {
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
await page.click('text=Talents')
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/talents`)
await expect(page.locator('a[href$="talents"] > div.selected')).toBeVisible()
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 ')
expect(await page.locator('div.selectPopup :text("Go To Vacancies")').count()).toBe(1)
await page.click('div.selectPopup :text("Go To Vacancies")')
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/vacancies`)
})
test('action-switch-applications', async ({ page }) => {
await page.click('[id="app-recruit\\:string\\:RecruitApplication"]')
await page.click('text=Talents')
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/talents`)
await expect(page.locator('a[href$="talents"] > div.selected')).toBeVisible()
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 ')
expect(await page.locator('div.selectPopup :text("Go To Applications")').count()).toBe(1)
await page.click('div.selectPopup :text("Go To Applications")')
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/candidates`)
})
})