mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
TESTS-98: feat(tests): done Created by filter test (#4161)
* feat(tests): TESTS-98 done Created by filter test Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
parent
7f7f494b80
commit
47b4f3f14d
@ -42,7 +42,7 @@ test.describe('actions tests', () => {
|
||||
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 page.click('div.selectPopup :text("Go To Vacancies")', { delay: 100 })
|
||||
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/vacancies`)
|
||||
})
|
||||
@ -62,7 +62,7 @@ test.describe('actions tests', () => {
|
||||
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 page.click('div.selectPopup :text("Go To Applications")', { delay: 100 })
|
||||
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/candidates`)
|
||||
})
|
||||
|
@ -63,4 +63,8 @@ export class CommonPage {
|
||||
await expect(page.locator('div.popup button[type="submit"]')).toBeVisible()
|
||||
await page.locator('div.popup button[type="submit"]').click()
|
||||
}
|
||||
|
||||
async pressButtonBack (page: Page): Promise<void> {
|
||||
await page.locator('div.history-box button:first-child').click()
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ export class IssuesDetailsPage extends CommonTrackerPage {
|
||||
readonly buttonMilestone: Locator
|
||||
readonly textEstimation: Locator
|
||||
readonly buttonEstimation: Locator
|
||||
readonly buttonCreatedBy: Locator
|
||||
readonly buttonCloseIssue: Locator
|
||||
readonly buttonMoreActions: Locator
|
||||
readonly textParentTitle: Locator
|
||||
|
||||
@ -32,6 +34,8 @@ export class IssuesDetailsPage extends CommonTrackerPage {
|
||||
this.buttonMilestone = page.locator('(//span[text()="Milestone"]/../div/div/button)[3]')
|
||||
this.textEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[4]')
|
||||
this.buttonEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[3]')
|
||||
this.buttonCreatedBy = page.locator('(//span[text()="Assignee"]/../div/button)[1]')
|
||||
this.buttonCloseIssue = page.locator('div.popupPanel-title > button')
|
||||
this.buttonMoreActions = page.locator('div.popupPanel-title div.flex-row-center > button:first-child')
|
||||
this.textParentTitle = page.locator('span.issue-title')
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ export class IssuesPage extends CommonTrackerPage {
|
||||
readonly linkSidebarAll: Locator
|
||||
readonly linkSidebarMyIssue: Locator
|
||||
readonly buttonClearFilers: Locator
|
||||
readonly issuesList: Locator
|
||||
readonly buttonPopupCreateNewIssueParent: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
@ -65,6 +66,7 @@ export class IssuesPage extends CommonTrackerPage {
|
||||
this.linkSidebarAll = page.locator('a[href$="all-issues"]')
|
||||
this.linkSidebarMyIssue = page.locator('a[href$="my-issues"]')
|
||||
this.buttonClearFilers = page.locator('div.search-start > div:first-child button')
|
||||
this.issuesList = page.locator('div.listGrid')
|
||||
this.buttonPopupCreateNewIssueParent = page.locator('div#parentissue-editor button')
|
||||
}
|
||||
|
||||
@ -150,7 +152,7 @@ export class IssuesPage extends CommonTrackerPage {
|
||||
async checkAllIssuesInStatus (statusId: string | undefined): Promise<void> {
|
||||
if (statusId === undefined) throw new Error(`Unknown status id ${statusId}`)
|
||||
|
||||
for await (const locator of iterateLocator(this.page.locator('div.listGrid'))) {
|
||||
for await (const locator of iterateLocator(this.issuesList)) {
|
||||
await expect(locator.locator('div[class*="square"] > svg')).toHaveAttribute('id', statusId)
|
||||
}
|
||||
}
|
||||
@ -170,7 +172,7 @@ export class IssuesPage extends CommonTrackerPage {
|
||||
}
|
||||
|
||||
async checkAllIssuesByPriority (priorityName: string): Promise<void> {
|
||||
for await (const locator of iterateLocator(this.page.locator('div.listGrid'))) {
|
||||
for await (const locator of iterateLocator(this.issuesList)) {
|
||||
const href = await locator.locator('div.priority-container use').getAttribute('href')
|
||||
expect(href).toContain(priorityName)
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import { NavigationMenuPage } from '../model/recruiting/navigation-menu-page'
|
||||
import { ApplicationsPage } from '../model/recruiting/applications-page'
|
||||
import { ApplicationsDetailsPage } from '../model/recruiting/applications-details-page'
|
||||
import { allure } from 'allure-playwright'
|
||||
import { VacancyDetailsPage } from '../model/recruiting/vacancy-details-page'
|
||||
import { VacanciesPage } from '../model/recruiting/vacancies-page'
|
||||
|
||||
test.use({
|
||||
storageState: PlatformSetting
|
||||
@ -28,11 +30,15 @@ test.describe('Application tests', () => {
|
||||
await page.click('button:has-text("Vacancy")')
|
||||
await page.fill('[placeholder="Software\\ Engineer"]', vacancyId)
|
||||
await page.click('button:has-text("Create")')
|
||||
await page.click(`tr > :has-text("${vacancyId}")`)
|
||||
|
||||
await page.click('text=Talents')
|
||||
const vacanciesPage = new VacanciesPage(page)
|
||||
await vacanciesPage.openVacancyByName(vacancyId)
|
||||
const vacancyDetailsPage = new VacancyDetailsPage(page)
|
||||
await expect(vacancyDetailsPage.inputComment).toBeVisible()
|
||||
|
||||
const navigationMenuPage = new NavigationMenuPage(page)
|
||||
await navigationMenuPage.buttonTalents.click()
|
||||
|
||||
await page.click('text=Talents')
|
||||
await page.click('text=P. Andrey')
|
||||
|
||||
// Click on Add button
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { test } from '@playwright/test'
|
||||
import { generateId, PlatformSetting, PlatformURI } from '../utils'
|
||||
import { expect, test } from '@playwright/test'
|
||||
import { generateId, iterateLocator, PlatformSetting, PlatformURI } from '../utils'
|
||||
import { LeftSideMenuPage } from '../model/left-side-menu-page'
|
||||
import { IssuesPage } from '../model/tracker/issues-page'
|
||||
import { NewIssue } from '../model/tracker/types'
|
||||
import { allure } from 'allure-playwright'
|
||||
import { DEFAULT_STATUSES, DEFAULT_STATUSES_ID, PRIORITIES } from './tracker.utils'
|
||||
import { IssuesDetailsPage } from '../model/tracker/issues-details-page'
|
||||
|
||||
test.use({
|
||||
storageState: PlatformSetting
|
||||
@ -243,4 +244,25 @@ test.describe('Tracker filters tests', () => {
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
test('Created by filter', async ({ page }) => {
|
||||
const createdBy = 'Appleseed John'
|
||||
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||
await leftSideMenuPage.buttonTracker.click()
|
||||
|
||||
const issuesPage = new IssuesPage(page)
|
||||
await issuesPage.modelSelectorAll.click()
|
||||
|
||||
await issuesPage.selectFilter('Created by', createdBy)
|
||||
await issuesPage.inputSearch.press('Escape')
|
||||
|
||||
await issuesPage.checkFilter('Created by', 'is')
|
||||
for await (const issue of iterateLocator(issuesPage.issuesList)) {
|
||||
await issue.locator('span.list > a').click()
|
||||
|
||||
const issuesDetailsPage = new IssuesDetailsPage(page)
|
||||
await expect(issuesDetailsPage.buttonCreatedBy).toHaveText(createdBy)
|
||||
await issuesDetailsPage.buttonCloseIssue.click()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user