Updated planning UI tests (#6211)

Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
Co-authored-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexander Platov 2024-08-01 20:18:08 +03:00 committed by GitHub
parent 0d18674027
commit 486ef0dc03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 304 additions and 132 deletions

View File

@ -3,7 +3,6 @@
"temp/**",
".build/**",
"coverage/**",
"**/*.svelte",
".build/**",
".validate/**",
".format/**",

View File

@ -190,6 +190,7 @@
{size}
icon={IconAdd}
showTooltip={{ label: create.label }}
dataId={'btnAdd'}
on:click={onCreate}
disabled={readonly || loading}
/>

View File

@ -146,12 +146,15 @@
kind={'ghost'}
size={'large'}
icon={show ? IconView : IconViewHide}
dataId={`btn${show ? 'Collapse' : 'Expand'}`}
on:click={() => {
show = !show
}}
/>
{/if}
{#if !hideAdd}<Button kind={'ghost'} size={'large'} icon={IconAdd} on:click={createTagElementPopup} />{/if}
{#if !hideAdd}
<Button kind={'ghost'} size={'large'} icon={IconAdd} dataId={'btnAdd'} on:click={createTagElementPopup} />
{/if}
</div>
<div class="scroll">
<div class="box">

View File

@ -58,6 +58,7 @@
icon={IconChevronLeft}
kind={'secondary'}
size={'small'}
dataId={'btnPrev'}
on:click={() => {
inc(-1)
}}
@ -69,6 +70,7 @@
type={!doubleRow ? 'type-button' : 'type-button-icon'}
kind={'secondary'}
size={'small'}
dataId={'btnToday'}
inheritFont
hasMenu
disabled={isToday}
@ -80,6 +82,7 @@
icon={IconChevronRight}
kind={'secondary'}
size={'small'}
dataId={'btnNext'}
on:click={() => {
inc(1)
}}

View File

@ -118,6 +118,7 @@
</button>
<button
class="filter-button hoverable lower"
data-id="btnCondition"
on:click={(e) => {
clickHandler(e, false)
}}

View File

@ -1,4 +1,5 @@
import { type Locator, type Page, expect } from '@playwright/test'
import { DateDivided } from './types'
export class CommonPage {
readonly page: Page
@ -11,9 +12,9 @@ export class CommonPage {
selectPopupInputSearch = (): Locator => this.page.locator('div.popup input.search')
selectPopupListItem = (name: string): Locator => this.page.locator('div.selectPopup div.list-item', { hasText: name })
selectPopupListItemFirst = (): Locator => this.page.locator('div.selectPopup div.list-item')
selectPopupHeaderButtonLast = (): Locator => this.page.locator('div.selectPopup div.header button:last-child')
selectPopupAddButton = (): Locator => this.page.locator('div.selectPopup button[data-id="btnAdd"]')
selectPopupButton = (): Locator => this.page.locator('div.selectPopup button')
selectPopupHeaderButtonFirst = (): Locator => this.page.locator('div.selectPopup div.header button:nth-of-type(1)')
selectPopupExpandButton = (): Locator => this.page.locator('div.selectPopup button[data-id="btnExpand"]')
popupSpanLabel = (point: string): Locator =>
this.page.locator('div[class$="opup"] span[class*="label"]', { hasText: point })
@ -46,6 +47,46 @@ export class CommonPage {
menuPopupItemButton = (itemText: string): Locator =>
this.page.locator('div.selectPopup button.menu-item', { hasText: itemText })
buttonFilter = (): Locator => this.page.getByRole('button', { name: 'Filter' })
inputFilterTitle = (): Locator => this.page.locator('div.selectPopup input[placeholder="Title"]')
inputSearch = (): Locator => this.page.locator('div.selectPopup input[placeholder="Search..."]')
buttonFilterApply = (): Locator => this.page.locator('div.selectPopup button[type="button"]', { hasText: 'Apply' })
buttonClearFilters = (): Locator => this.page.locator('button > span', { hasText: 'Clear filters' })
filterButton = (index: number): Locator => this.page.locator(`div.filter-section button:nth-child(${index})`)
selectFilterSection = (label: string): Locator =>
this.page.locator('div.filterbar-container div.filter-section', { hasText: label })
selectPopupMenu = (filter: string): Locator =>
this.page.locator('div.selectPopup [class*="menu"]', { hasText: filter })
calendarDay = (daySelector: string): Locator => this.page.locator(`div.popup div.calendar button.day${daySelector}`)
linesFromTable = (text: string = ''): Locator =>
this.page.locator('.hulyComponent table tbody tr').filter({ hasText: text })
linesFromList = (text: string = ''): Locator =>
this.page.locator('.hulyComponent .list-container div.row').filter({ hasText: text })
firstInputFirstDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:first-child span.digit:first-child')
firstInputThirdDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:first-child span.digit:nth-child(3)')
firstInputFifthDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:first-child span.digit:nth-child(5)')
lastInputFirstDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:last-child span.digit:first-child')
lastInputThirdDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:last-child span.digit:nth-child(3)')
lastInputFifthDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:last-child span.digit:nth-child(5)')
submitButton = (): Locator => this.page.locator('div.date-popup-container button[type="submit"]')
async selectMenuItem (page: Page, name: string, fullWordFilter: boolean = false): Promise<void> {
if (name !== 'first') {
const filterText = fullWordFilter ? name : name.split(' ')[0]
@ -57,11 +98,11 @@ export class CommonPage {
}
async pressCreateButtonSelectPopup (page: Page): Promise<void> {
await this.selectPopupHeaderButtonLast().click()
await this.selectPopupAddButton().click()
}
async pressShowAllButtonSelectPopup (page: Page): Promise<void> {
await this.selectPopupHeaderButtonFirst().click()
await this.selectPopupExpandButton().click()
}
async selectFromDropdown (page: Page, point: string): Promise<void> {
@ -159,4 +200,102 @@ export class CommonPage {
async checkPopupItem (itemText: string): Promise<void> {
await expect(this.menuPopupItemButton(itemText)).toBeVisible()
}
async selectFilter (filter: string, filterSecondLevel?: string): Promise<void> {
await this.buttonFilter().click()
await this.selectPopupMenu(filter).click()
if (filterSecondLevel !== null && typeof filterSecondLevel === 'string') {
switch (filter) {
case 'Title':
await this.inputFilterTitle().fill(filterSecondLevel)
await this.buttonFilterApply().click()
break
case 'Labels':
await this.selectFromDropdown(this.page, filterSecondLevel)
break
case 'Skills':
await this.inputSearch().fill(filterSecondLevel)
await this.selectFromDropdown(this.page, filterSecondLevel)
await this.page.keyboard.press('Escape')
break
default:
await this.selectPopupMenu(filterSecondLevel).click()
}
}
}
async filterOppositeCondition (filter: string, conditionBefore: string, conditionAfter: string): Promise<void> {
const filterSection = this.selectFilterSection(filter)
await filterSection.locator('button', { hasText: conditionBefore }).isVisible()
await filterSection.locator('button[data-id="btnCondition"]').click()
await this.page.locator('div.selectPopup button.menu-item', { hasText: conditionAfter }).click()
}
async checkFilter (filter: string, filterSecondLevel?: string, filterThirdLevel?: string): Promise<void> {
await expect(this.filterButton(1)).toHaveText(filter)
if (filterSecondLevel !== undefined) {
await expect(this.filterButton(2)).toContainText(filterSecondLevel)
}
if (filterThirdLevel !== undefined) {
await expect(this.filterButton(3)).toContainText(filterThirdLevel)
}
}
async updateFilterDimension (
filterSecondLevel: string,
dateStart?: string,
needToOpenCalendar: boolean = false
): Promise<void> {
await this.filterButton(2).click()
await this.selectPopupMenu(filterSecondLevel).click()
if (dateStart !== undefined) {
if (needToOpenCalendar) {
await this.filterButton(3).click()
}
await this.calendarDay(dateStart === 'Today' ? '.today' : `:has-text("${dateStart}")`).click()
}
}
async fillBetweenDate (dateStart: DateDivided, dateEnd: DateDivided): Promise<void> {
// dateStart - day
await this.firstInputFirstDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.firstInputFirstDigit().pressSequentially(dateStart.day)
// dateStart - month
await this.firstInputThirdDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.firstInputThirdDigit().pressSequentially(dateStart.month)
// dateStart - year
await this.firstInputFifthDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.firstInputFifthDigit().pressSequentially(dateStart.year)
// dateEnd - day
await this.lastInputFirstDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.lastInputFirstDigit().pressSequentially(dateEnd.day)
// dateEnd - month
await this.lastInputThirdDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.lastInputThirdDigit().pressSequentially(dateEnd.month)
// dateEnd - year
await this.lastInputFifthDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.lastInputFifthDigit().pressSequentially(dateEnd.year)
// Submit
await this.submitButton().click({ delay: 100 })
}
async checkRowsInTableExist (text: string, count: number = 1): Promise<void> {
await expect(this.linesFromTable(text)).toHaveCount(count)
}
async checkRowsInTableNotExist (text: string): Promise<void> {
await expect(this.linesFromTable(text)).toHaveCount(0)
}
async openRowInTableByText (text: string): Promise<void> {
await this.linesFromTable(text).locator('a', { hasText: text }).click()
}
}

View File

@ -15,6 +15,8 @@ export class LeftSideMenuPage extends CommonPage {
buttonRecruiting = (): Locator => this.page.locator('[id="app-recruit\\:string\\:RecruitApplication"]')
buttonNotification = (): Locator => this.page.locator('button[id$="Inbox"]')
buttonDocuments = (): Locator => this.page.locator('button[id$="document:string:DocumentApplication"]')
buttonPlanner = (): Locator => this.page.locator('button[id$="app-time:string:Planner"]')
buttonTeam = (): Locator => this.page.locator('button[id$="app-time:string:Team"]')
profileButton = (): Locator => this.page.locator('#profile-button')
inviteToWorkspaceButton = (): Locator => this.page.locator('button:has-text("Invite to workspace")')
getInviteLinkButton = (): Locator => this.page.locator('button:has-text("Get invite link")')
@ -53,6 +55,14 @@ export class LeftSideMenuPage extends CommonPage {
await this.buttonDocuments().click()
}
async clickPlanner (): Promise<void> {
await this.buttonPlanner().click()
}
async clickTeam (): Promise<void> {
await this.buttonTeam().click()
}
async clickRecruiting (): Promise<void> {
await this.buttonRecruiting().click()
}

View File

@ -1,4 +1,4 @@
import { type Locator, type Page } from '@playwright/test'
import { type Locator, type Page, expect } from '@playwright/test'
export class PlanningNavigationMenuPage {
readonly page: Page
@ -20,6 +20,9 @@ export class PlanningNavigationMenuPage {
readonly buttonToDoPlanned = (): Locator =>
this.page.locator('button[class*="hulyNavItem-container"] span[class*="hulyNavItem-label"]:text-is("Planned")')
readonly accordionContainerToDoUnplanned = (): Locator =>
this.page.locator('div.toDos-container div.hulyAccordionItem-container', { hasText: 'Unplanned' })
async clickOnButtonToDoAll (): Promise<void> {
await this.buttonToDoAll().click()
}
@ -31,4 +34,13 @@ export class PlanningNavigationMenuPage {
async clickOnButtonToDoPlanned (): Promise<void> {
await this.buttonToDoPlanned().click()
}
async compareCountersUnplannedToDos (): Promise<void> {
const navCount = parseInt(
await this.buttonToDoUnplanned().locator('xpath=..').locator('span.hulyNavItem-count').innerText(),
10
)
const accCount = await this.accordionContainerToDoUnplanned().locator('button.hulyToDoLine-container').count()
expect(accCount).toBe(navCount)
}
}

View File

@ -30,6 +30,9 @@ export class PlanningPage extends CalendarPage {
readonly buttonPopupVisibleToEveryone = (): Locator =>
this.popup().getByRole('button', { name: 'Visible to everyone' })
readonly buttonPopupOnlyVisibleToYou = (): Locator =>
this.popup().getByRole('button', { name: 'Only visible to you' })
readonly buttonPopupSave = (): Locator => this.popup().getByRole('button', { name: 'Save' })
readonly buttonPopupCreateAddLabel = (): Locator =>
this.popup().locator('button.antiButton', { hasText: 'Add label' })

View File

@ -10,6 +10,7 @@ export class TalentDetailsPage extends CommonRecruitingPage {
this.page = page
}
readonly buttonClosePanel = (): Locator => this.page.locator('#btnPClose')
readonly buttonAddSkill = (): Locator => this.page.locator('button#add-tag')
readonly textTagItem = (): Locator => this.page.locator('div.tag-item')
readonly inputLocation = (): Locator => this.page.locator('div.location input')

View File

@ -0,0 +1,26 @@
import { expect, Locator, Page } from '@playwright/test'
import { CommonPage } from './common-page'
export class TeamPage extends CommonPage {
readonly page: Page
constructor (page: Page) {
super(page)
this.page = page
}
appHeader = (): Locator => this.page.locator('div.hulyNavPanel-header', { hasText: 'Team Planner' })
buttonTeam = (name: string): Locator =>
this.page.locator('div#navGroup-projects-planning button.hulyNavItem-container', { hasText: name })
buttonNextDay = (): Locator =>
this.page.locator('div.hulyComponent div.hulyHeader-container .actions button[data-id="btnNext"]')
async checkTeamPageIsOpened (): Promise<void> {
await expect(this.appHeader()).toBeVisible()
}
async selectTeam (name: string): Promise<void> {
await this.buttonTeam(name).click()
}
}

View File

@ -1,6 +1,5 @@
import { expect, Locator, Page } from '@playwright/test'
import { CalendarPage } from '../calendar-page'
import { DateDivided } from './types'
import path from 'path'
export class CommonTrackerPage extends CalendarPage {
@ -36,16 +35,9 @@ export class CommonTrackerPage extends CalendarPage {
this.page.locator('div[slot="header"] div.item div.name', { hasText: fileName })
commentImg = (): Locator => this.page.locator('div.activityMessage div.content img')
inputFilterTitle = (): Locator => this.page.locator('div.selectPopup input[placeholder="Title"]')
buttonFilterApply = (): Locator => this.page.locator('div.selectPopup button[type="button"]', { hasText: 'Apply' })
buttonClearFilters = (): Locator => this.page.locator('button > span', { hasText: 'Clear filters' })
textCategoryHeader = (): Locator =>
this.page.locator('div.category-container > div.categoryHeader span[class*="label"]')
buttonFilter = (): Locator => this.page.getByRole('button', { name: 'Filter' })
selectPopupMenu = (filter: string): Locator =>
this.page.locator('div.selectPopup [class*="menu"]', { hasText: filter })
popupCalendarButton = (dateStart: string): Locator =>
this.page.locator('div.popup div.calendar button.day', { hasText: dateStart })
@ -59,27 +51,6 @@ export class CommonTrackerPage extends CalendarPage {
this.page.locator('div.date-popup-container div.input:first-child span.digit:nth-child(5)')
submitDatePopup = (): Locator => this.page.locator('div.date-popup-container button[type="submit"]')
filterButton = (index: number): Locator => this.page.locator(`div.filter-section button:nth-child(${index})`)
calendarDay = (daySelector: string): Locator => this.page.locator(`div.popup div.calendar button.day${daySelector}`)
firstInputFirstDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:first-child span.digit:first-child')
firstInputThirdDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:first-child span.digit:nth-child(3)')
firstInputFifthDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:first-child span.digit:nth-child(5)')
lastInputFirstDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:last-child span.digit:first-child')
lastInputThirdDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:last-child span.digit:nth-child(3)')
lastInputFifthDigit = (): Locator =>
this.page.locator('div.date-popup-container div.input:last-child span.digit:nth-child(5)')
submitButton = (): Locator => this.page.locator('div.date-popup-container button[type="submit"]')
trackerApplicationButton = (): Locator => this.page.locator('[id="app-tracker\\:string\\:TrackerApplication"]')
componentsLink = (): Locator => this.page.locator('text=Components')
@ -101,7 +72,6 @@ export class CommonTrackerPage extends CalendarPage {
header = (): Locator =>
this.page.locator('button.hulyBreadcrumb-container > span.hulyBreadcrumb-label', { hasText: 'Issues' })
filter = (): Locator => this.page.getByRole('button', { name: 'Filter' })
view = (): Locator => this.page.locator('.hulyHeader-buttonsGroup > button[data-id="btn-viewOptions"]')
showMore = (): Locator => this.page.locator('.hulyHeader-buttonsGroup > button[data-id="btn-viewSetting"]')
task1 = (): Locator => this.page.getByRole('link', { name: 'Welcome to Huly! 🌟' })
@ -177,80 +147,6 @@ export class CommonTrackerPage extends CalendarPage {
await this.page.waitForSelector('form.antiCard', { state: 'detached' })
}
async selectFilter (filter: string, filterSecondLevel?: string): Promise<void> {
await this.buttonFilter().click()
await this.selectPopupMenu(filter).click()
if (filterSecondLevel !== null && typeof filterSecondLevel === 'string') {
switch (filter) {
case 'Title':
await this.inputFilterTitle().fill(filterSecondLevel)
await this.buttonFilterApply().click()
break
case 'Labels':
await this.selectFromDropdown(this.page, filterSecondLevel)
break
default:
await this.selectPopupMenu(filterSecondLevel).click()
}
}
}
async checkFilter (filter: string, filterSecondLevel?: string, filterThirdLevel?: string): Promise<void> {
await expect(this.filterButton(1)).toHaveText(filter)
if (filterSecondLevel !== undefined) {
await expect(this.filterButton(2)).toContainText(filterSecondLevel)
}
if (filterThirdLevel !== undefined) {
await expect(this.filterButton(3)).toContainText(filterThirdLevel)
}
}
async updateFilterDimension (
filterSecondLevel: string,
dateStart?: string,
needToOpenCalendar: boolean = false
): Promise<void> {
await this.filterButton(2).click()
await this.selectPopupMenu(filterSecondLevel).click()
if (dateStart !== undefined) {
if (needToOpenCalendar) {
await this.filterButton(3).click()
}
await this.calendarDay(dateStart === 'Today' ? '.today' : `:has-text("${dateStart}")`).click()
}
}
async fillBetweenDate (dateStart: DateDivided, dateEnd: DateDivided): Promise<void> {
// dateStart - day
await this.firstInputFirstDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.firstInputFirstDigit().pressSequentially(dateStart.day)
// dateStart - month
await this.firstInputThirdDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.firstInputThirdDigit().pressSequentially(dateStart.month)
// dateStart - year
await this.firstInputFifthDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.firstInputFifthDigit().pressSequentially(dateStart.year)
// dateEnd - day
await this.lastInputFirstDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.lastInputFirstDigit().pressSequentially(dateEnd.day)
// dateEnd - month
await this.lastInputThirdDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.lastInputThirdDigit().pressSequentially(dateEnd.month)
// dateEnd - year
await this.lastInputFifthDigit().click({ delay: 100, position: { x: 1, y: 1 } })
await this.lastInputFifthDigit().pressSequentially(dateEnd.year)
// Submit
await this.submitButton().click({ delay: 100 })
}
async addComment (comment: string): Promise<void> {
await this.inputComment().fill(comment)
await this.buttonSendComment().click()
@ -313,7 +209,7 @@ export class CommonTrackerPage extends CalendarPage {
async checkIfMainPanelIsVisible (): Promise<void> {
await expect(this.header()).toBeVisible({ timeout: 60000 })
await expect(this.filter()).toBeVisible()
await expect(this.buttonFilter()).toBeVisible()
await expect(this.view()).toBeVisible()
await expect(this.showMore()).toBeVisible()
}

View File

@ -63,7 +63,6 @@ export class IssuesPage extends CommonTrackerPage {
buttonCollapsedCategories = (): Locator => this.page.locator('div.categoryHeader.collapsed')
pupupTagsPopup = (): Locator => this.page.locator('.popup#TagsPopup')
issueNotExist = (issueName: string): Locator => this.page.locator('tr', { hasText: issueName })
filterRowExists = (issueName: string): Locator => this.page.locator('div.row span', { hasText: issueName })
issueListGrid = (): Locator => this.page.locator('div.listGrid')
issueList = (): Locator => this.page.locator('div[class*="square"] > div')
issueByName = (issueName: string): Locator => this.page.locator('a', { hasText: issueName })
@ -512,11 +511,11 @@ export class IssuesPage extends CommonTrackerPage {
}
async checkFilteredIssueExist (issueName: string): Promise<void> {
await expect(this.filterRowExists(issueName)).toHaveCount(1)
await expect(this.linesFromList(issueName)).toHaveCount(1)
}
async checkFilteredIssueNotExist (issueName: string): Promise<void> {
await expect(this.filterRowExists(issueName)).toHaveCount(0)
await expect(this.linesFromList(issueName)).toHaveCount(0)
}
async checkAllIssuesInStatus (statusId?: string, statusName?: string): Promise<void> {

View File

@ -49,9 +49,3 @@ export interface NewComponent {
description?: string
lead?: string
}
export interface DateDivided {
day: string
month: string
year: string
}

View File

@ -0,0 +1,5 @@
export interface DateDivided {
day: string
month: string
year: string
}

View File

@ -1,8 +1,16 @@
import { test } from '@playwright/test'
import { generateId, PlatformSetting, PlatformURI } from '../utils'
import { generateId, PlatformSetting, PlatformURI, generateTestData } from '../utils'
import { PlanningPage } from '../model/planning/planning-page'
import { NewToDo } from '../model/planning/types'
import { PlanningNavigationMenuPage } from '../model/planning/planning-navigation-menu-page'
import { SignUpData } from '../model/common-types'
import { TestData } from '../chat/types'
import { faker } from '@faker-js/faker'
import { LeftSideMenuPage } from '../model/left-side-menu-page'
import { ApiEndpoint } from '../API/Api'
import { LoginPage } from '../model/login-page'
import { SignInJoinPage } from '../model/signin-page'
import { TeamPage } from '../model/team-page'
test.use({
storageState: PlatformSetting
@ -160,22 +168,74 @@ test.describe('Planning ToDo tests', () => {
await planningPage.checkTimeSlotEndDate(1, dateEndTomorrow.getDate().toString())
})
test("Drag'n'drop added Todo", async ({ page }) => {
test('Adding ToDo by dragging and checking visibility in the Team Planner', async ({ browser, page, request }) => {
const data: TestData = generateTestData()
const newUser2: SignUpData = {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
password: '1234'
}
const titleV = `Visible ToDo ${generateId()}`
const titleI = `Inisible ToDo ${generateId()}`
let hour = new Date().getHours()
const ampm = hour < 13 ? 'am' : 'pm'
hour = hour < 1 ? 1 : hour >= 11 && hour < 13 ? 11 : hour >= 22 ? 10 : hour > 12 ? hour - 12 : hour
const time = `${hour}${ampm}`
const title = `Drag and drop ToDo ${generateId()}`
const timeV = `${hour}${ampm}`
const timeI = `${hour + 1}${ampm}`
const leftSideMenuPage: LeftSideMenuPage = new LeftSideMenuPage(page)
const loginPage: LoginPage = new LoginPage(page)
const api: ApiEndpoint = new ApiEndpoint(request)
await api.createAccount(data.userName, '1234', data.firstName, data.lastName)
await api.createWorkspaceWithLogin(data.workspaceName, data.userName, '1234')
await (await page.goto(`${PlatformURI}`))?.finished()
await loginPage.login(data.userName, '1234')
await (await page.goto(`${PlatformURI}/workbench/${data.workspaceName}`))?.finished()
await leftSideMenuPage.clickPlanner()
const planningNavigationMenuPage = new PlanningNavigationMenuPage(page)
await planningNavigationMenuPage.clickOnButtonToDoAll()
const planningPage = new PlanningPage(page)
await planningPage.selectInputToDo().fill(title)
await planningPage.selectInputToDo().fill(titleV)
await planningPage.selectInputToDo().press('Enter')
await planningPage.dragdropTomorrow(title, time)
await planningPage.eventInSchedule(title).click()
await planningPage.dragdropTomorrow(titleV, timeV)
await planningPage.eventInSchedule(titleV).click()
await planningPage.buttonPopupCreateVisible().click()
await planningPage.buttonPopupVisibleToEveryone().click()
await planningPage.buttonPopupSave().click()
await planningPage.selectInputToDo().fill(titleI)
await planningPage.selectInputToDo().press('Enter')
await planningPage.dragdropTomorrow(titleI, timeI)
await planningPage.eventInSchedule(titleI).click()
await planningPage.buttonPopupCreateVisible().click()
await planningPage.buttonPopupOnlyVisibleToYou().click()
await planningPage.buttonPopupSave().click()
await leftSideMenuPage.openProfileMenu()
await leftSideMenuPage.inviteToWorkspace()
await leftSideMenuPage.getInviteLink()
const linkText = await page.locator('.antiPopup .link').textContent()
const page2 = await browser.newPage()
const leftSideMenuPageSecond = new LeftSideMenuPage(page2)
await api.createAccount(newUser2.email, newUser2.password, newUser2.firstName, newUser2.lastName)
await page2.goto(linkText ?? '')
const joinPage = new SignInJoinPage(page2)
await joinPage.join(newUser2)
await leftSideMenuPageSecond.clickTeam()
const teamPage = new TeamPage(page2)
await teamPage.checkTeamPageIsOpened()
await teamPage.selectTeam('Default')
await teamPage.buttonNextDay().click()
await page2
.locator('div.hulyComponent div.item', { hasText: 'Tomorrow' })
.locator('div.item', { hasText: 'Busy 30m' })
.isVisible()
await page2.close()
})
})

View File

@ -13,7 +13,7 @@ test.describe('Planning ToDo tests', () => {
await (await page.goto(`${PlatformURI}/workbench/sanity-ws/time`))?.finished()
})
test('New ToDo', async ({ page }) => {
test('New ToDo and checking notifications about unplanned tasks', async ({ page }) => {
const dateEnd = new Date()
dateEnd.setDate(dateEnd.getDate() + 1)
@ -40,9 +40,11 @@ test.describe('Planning ToDo tests', () => {
}
const planningPage = new PlanningPage(page)
await planningPage.createNewToDo(newToDo)
const planningNavigationMenuPage = new PlanningNavigationMenuPage(page)
await planningNavigationMenuPage.clickOnButtonUnplanned()
await planningNavigationMenuPage.compareCountersUnplannedToDos()
await planningPage.createNewToDo(newToDo)
await planningNavigationMenuPage.compareCountersUnplannedToDos()
await planningNavigationMenuPage.clickOnButtonToDoAll()
await planningPage.checkToDoExist(newToDo.title)

View File

@ -131,4 +131,21 @@ test.describe('candidate/talents tests', () => {
await talentsPage.rightClickAction(talentName, 'Match to vacancy')
await talentsPage.checkMatchVacancy(`${talentName.lastName} ${talentName.firstName}`, '0')
})
test('Filtering talents by skills', async ({ page }) => {
const skillName = `Skill-${generateId(4)}`
const talentName = 'P. Andrey'
await navigationMenuPage.clickButtonTalents()
await talentsPage.checkRowsInTableExist(talentName)
const talentsCount = await talentsPage.linesFromTable().count()
await talentsPage.openRowInTableByText(talentName)
await talentDetailsPage.addSkill(skillName, 'Skill Description')
await talentDetailsPage.buttonClosePanel().click()
await talentsPage.selectFilter('Skills', skillName)
await talentsPage.checkRowsInTableExist(talentName)
await talentsPage.filterOppositeCondition('Skill', 'is', 'is not')
await talentsPage.checkRowsInTableNotExist(talentName)
await talentsPage.checkRowsInTableExist('', talentsCount - 1)
})
})

View File

@ -2,7 +2,8 @@ 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 { DateDivided, NewIssue } from '../model/tracker/types'
import { NewIssue } from '../model/tracker/types'
import { DateDivided } from '../model/types'
import { DEFAULT_STATUSES, DEFAULT_STATUSES_ID, PRIORITIES } from './tracker.utils'
import { IssuesDetailsPage } from '../model/tracker/issues-details-page'