diff --git a/plugins/document-resources/src/components/navigator/DocTreeElement.svelte b/plugins/document-resources/src/components/navigator/DocTreeElement.svelte
index db0794da4c..43a6a0fba4 100644
--- a/plugins/document-resources/src/components/navigator/DocTreeElement.svelte
+++ b/plugins/document-resources/src/components/navigator/DocTreeElement.svelte
@@ -75,12 +75,20 @@
icon={action.icon}
kind={'tertiary'}
size={'extra-small'}
+ dataId={action.label}
tooltip={{ label: action.label, direction: 'top' }}
on:click={(evt) => action.action({}, evt)}
/>
{/if}
{/each}
-
+
diff --git a/tests/sanity/tests/chat/chat.spec.ts b/tests/sanity/tests/chat/chat.spec.ts
index c2237960a5..44af888e6f 100644
--- a/tests/sanity/tests/chat/chat.spec.ts
+++ b/tests/sanity/tests/chat/chat.spec.ts
@@ -416,6 +416,7 @@ test.describe('channel tests', () => {
})
test('Checking backlinks in the Chat', async ({ browser, page }) => {
+ await api.createAccount(newUser2.email, newUser2.password, newUser2.firstName, newUser2.lastName)
await leftSideMenuPage.openProfileMenu()
await leftSideMenuPage.inviteToWorkspace()
await leftSideMenuPage.getInviteLink()
@@ -424,10 +425,10 @@ test.describe('channel tests', () => {
const page2 = await browser.newPage()
const leftSideMenuPageSecond = new LeftSideMenuPage(page2)
const channelPageSecond = new ChannelPage(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.clickChunter()
await leftSideMenuPage.clickChunter()
await channelPage.clickChannel('general')
@@ -435,7 +436,6 @@ test.describe('channel tests', () => {
await channelPage.sendMention(mentionName)
await channelPage.checkMessageExist(`@${mentionName}`, true, `@${mentionName}`)
- await leftSideMenuPageSecond.clickChunter()
await channelPageSecond.clickChannel('general')
await channelPageSecond.checkMessageExist(`@${mentionName}`, true, `@${mentionName}`)
await page2.close()
diff --git a/tests/sanity/tests/collaborative/issues.spec.ts b/tests/sanity/tests/collaborative/issues.spec.ts
index 8ed4cb8897..7b7827c241 100644
--- a/tests/sanity/tests/collaborative/issues.spec.ts
+++ b/tests/sanity/tests/collaborative/issues.spec.ts
@@ -69,11 +69,7 @@ test.describe('Collaborative test for issue', () => {
await issuesPageSecond.openIssueByName(newIssue.title)
const issuesDetailsPageSecond = new IssuesDetailsPage(userSecondPage)
- await issuesDetailsPageSecond.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPageSecond.checkIssue(newIssue)
await closePages()
})
@@ -176,7 +172,7 @@ test.describe('Collaborative test for issue', () => {
await issuesPageSecond.openIssueByName(issue.title)
const issuesDetailsPageSecond = new IssuesDetailsPage(userSecondPage)
- await issuesDetailsPageSecond.checkIssue({ ...issue })
+ await issuesDetailsPageSecond.checkIssue(issue)
})
await closePages()
diff --git a/tests/sanity/tests/documents/documents.spec.ts b/tests/sanity/tests/documents/documents.spec.ts
index c2b2099575..50b8acdf5d 100644
--- a/tests/sanity/tests/documents/documents.spec.ts
+++ b/tests/sanity/tests/documents/documents.spec.ts
@@ -150,4 +150,23 @@ test.describe('Documents tests', () => {
await documentContentPage.addLinkToText(contentLink, 'test/link/123456')
await documentContentPage.checkLinkInTheText(contentLink, 'test/link/123456')
})
+
+ test('Locked document and checking URL', async ({ page, context }) => {
+ const newDocument: NewDocument = {
+ title: `New Document-${generateId()}`,
+ space: 'Default'
+ }
+
+ await leftSideMenuPage.clickDocuments()
+ await documentsPage.clickOnButtonCreateDocument()
+ await documentsPage.createDocument(newDocument)
+ await documentsPage.selectMoreActionOfDocument(newDocument.title, 'Lock')
+ await documentsPage.selectMoreActionOfDocument(newDocument.title, 'Copy document URL to clipboard')
+ await context.grantPermissions(['clipboard-read'])
+ const handle = await page.evaluateHandle(() => navigator.clipboard.readText())
+ const clipboardContent = await handle.jsonValue()
+ await page.goto(`${clipboardContent}`)
+ await documentContentPage.checkDocumentTitle(newDocument.title)
+ await documentContentPage.checkDocumentLocked()
+ })
})
diff --git a/tests/sanity/tests/inbox/inbox.spec.ts b/tests/sanity/tests/inbox/inbox.spec.ts
index d20d2d4fea..5c8aa99a16 100644
--- a/tests/sanity/tests/inbox/inbox.spec.ts
+++ b/tests/sanity/tests/inbox/inbox.spec.ts
@@ -1,5 +1,5 @@
import { test } from '@playwright/test'
-import { PlatformURI, generateTestData } from '../utils'
+import { PlatformURI, generateTestData, getTimeForPlanner, attachScreenshot } from '../utils'
import { LeftSideMenuPage } from '../model/left-side-menu-page'
import { ApiEndpoint } from '../API/Api'
import { LoginPage } from '../model/login-page'
@@ -13,6 +13,8 @@ import { ChannelPage } from '../model/channel-page'
import { UserProfilePage } from '../model/profile/user-profile-page'
import { MenuItems, NotificationsPage } from '../model/profile/notifications-page'
import { SelectWorkspacePage } from '../model/select-workspace-page'
+import { PlanningPage } from '../model/planning/planning-page'
+import { TeamPage } from '../model/team-page'
test.describe('Inbox tests', () => {
let leftSideMenuPage: LeftSideMenuPage
@@ -49,11 +51,7 @@ test.describe('Inbox tests', () => {
test('User is able to create a task, assign a himself and see it inside the inbox', async ({ page }) => {
const newIssue = createNewIssueData(data.firstName, data.lastName)
await prepareNewIssueWithOpenStep(page, newIssue)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
await leftSideMenuPage.clickTracker()
await leftSideMenuPage.clickNotification()
@@ -63,44 +61,28 @@ test.describe('Inbox tests', () => {
test('User is able to create a task, assign a himself and open it from inbox', async ({ page }) => {
const newIssue = createNewIssueData(data.firstName, data.lastName)
await prepareNewIssueWithOpenStep(page, newIssue)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
await leftSideMenuPage.clickTracker()
await leftSideMenuPage.clickNotification()
await inboxPage.checkIfTaskIsPresentInInbox(newIssue.title)
await inboxPage.clickOnToDo(newIssue.title)
await inboxPage.clickLeftSidePanelOpen()
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
})
test.skip('User is able to create a task, assign a himself and close it from inbox', async ({ page }) => {
const newIssue = createNewIssueData(data.firstName, data.lastName)
await prepareNewIssueWithOpenStep(page, newIssue)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
await leftSideMenuPage.clickTracker()
await leftSideMenuPage.clickNotification()
await inboxPage.checkIfTaskIsPresentInInbox(newIssue.title)
await inboxPage.clickOnToDo(newIssue.title)
await inboxPage.clickLeftSidePanelOpen()
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
await inboxPage.clickCloseLeftSidePanel()
// ADD ASSERT ONCE THE ISSUE IS FIXED
})
@@ -120,11 +102,7 @@ test.describe('Inbox tests', () => {
const newIssue = createNewIssueData(newUser2.firstName, newUser2.lastName)
await prepareNewIssueWithOpenStep(page, newIssue)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
await leftSideMenuPageSecond.clickTracker()
await leftSideMenuPageSecond.clickNotification()
await inboxPageSecond.checkIfTaskIsPresentInInbox(newIssue.title)
@@ -147,21 +125,13 @@ test.describe('Inbox tests', () => {
const newIssue = createNewIssueData(newUser2.firstName, newUser2.lastName)
await prepareNewIssueWithOpenStep(page, newIssue)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
await leftSideMenuPageSecond.clickTracker()
await leftSideMenuPageSecond.clickNotification()
await inboxPageSecond.checkIfTaskIsPresentInInbox(newIssue.title)
await inboxPageSecond.clickOnToDo(newIssue.title)
await inboxPageSecond.clickLeftSidePanelOpen()
- await issuesDetailsPageSecond.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPageSecond.checkIssue(newIssue)
await page2.close()
})
test.skip('User is able to create a task, assign a other user and close it from inbox', async ({ page, browser }) => {
@@ -180,21 +150,13 @@ test.describe('Inbox tests', () => {
const newIssue = createNewIssueData(newUser2.firstName, newUser2.lastName)
await prepareNewIssueWithOpenStep(page, newIssue)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
await leftSideMenuPageSecond.clickTracker()
await leftSideMenuPageSecond.clickNotification()
await inboxPageSecond.checkIfTaskIsPresentInInbox(newIssue.title)
await inboxPageSecond.clickOnToDo(newIssue.title)
await inboxPageSecond.clickLeftSidePanelOpen()
- await issuesDetailsPageSecond.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPageSecond.checkIssue(newIssue)
await inboxPage.clickCloseLeftSidePanel()
// ADD ASSERT ONCE THE ISSUE IS FIXED
await page2.close()
@@ -285,11 +247,7 @@ test.describe('Inbox tests', () => {
const newIssue = createNewIssueData(newUser2.firstName, newUser2.lastName)
await prepareNewIssueWithOpenStep(page, newIssue)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
await leftSideMenuPageSecond.clickTracker()
await leftSideMenuPageSecond.clickNotification()
await inboxPageSecond.clickOnInboxFilter('Channels')
@@ -300,4 +258,51 @@ test.describe('Inbox tests', () => {
await inboxPageSecond.checkIfInboxChatExists('Channel general', false)
await page2.close()
})
+
+ test('Checking the ability to receive a task and schedule it', async ({ page, browser }) => {
+ await leftSideMenuPage.openProfileMenu()
+ await leftSideMenuPage.inviteToWorkspace()
+ await leftSideMenuPage.getInviteLink()
+ const linkText = await page.locator('.antiPopup .link').textContent()
+ await leftSideMenuPage.clickOnCloseInvite()
+
+ const page2 = await browser.newPage()
+ await page2.goto(linkText ?? '')
+ const joinPage = new SignInJoinPage(page2)
+ await joinPage.join(newUser2)
+
+ const newIssue = createNewIssueData(data.firstName, data.lastName, {
+ status: 'Todo',
+ assignee: `${newUser2.lastName} ${newUser2.firstName}`,
+ estimation: '0'
+ })
+ await prepareNewIssueWithOpenStep(page, newIssue)
+ await issuesDetailsPage.checkIssue(newIssue)
+
+ const leftSideMenuPageSecond = new LeftSideMenuPage(page2)
+ const inboxPageSecond = new InboxPage(page2)
+ const issuesDetailsPageSecond = new IssuesDetailsPage(page2)
+ const planningPageSecond = new PlanningPage(page2)
+ await leftSideMenuPageSecond.clickNotification()
+ await inboxPageSecond.checkIfIssueIsPresentInInbox(newIssue.title)
+ await inboxPageSecond.clickIssuePresentInInbox(newIssue.title)
+ await inboxPageSecond.clickLeftSidePanelOpen()
+ await issuesDetailsPageSecond.checkIssue(newIssue)
+ await leftSideMenuPageSecond.clickPlanner()
+ await planningPageSecond.closeNotification()
+ await planningPageSecond.dragdropTomorrow(newIssue.title, getTimeForPlanner())
+ await planningPageSecond.eventInSchedule(newIssue.title).isVisible()
+ await attachScreenshot('Recive_task_and_scheduled.png', page2)
+
+ await attachScreenshot('Recive_task_and_scheduled-Detail.png', page)
+ await issuesDetailsPage.checkIssue({ ...newIssue, status: 'In Progress' })
+ await leftSideMenuPage.clickTeam()
+ const teamPage = new TeamPage(page)
+ await teamPage.checkTeamPageIsOpened()
+ await teamPage.selectTeam('Default')
+ await teamPage.buttonNextDay().click()
+ await attachScreenshot('Recive_task_and_scheduled-Tomorrow.png', page)
+ await teamPage.getItemByText('Tomorrow', newIssue.title).isVisible()
+ await page2.close()
+ })
})
diff --git a/tests/sanity/tests/model/common-page.ts b/tests/sanity/tests/model/common-page.ts
index cd94426f64..0f6083b9b0 100644
--- a/tests/sanity/tests/model/common-page.ts
+++ b/tests/sanity/tests/model/common-page.ts
@@ -31,7 +31,7 @@ export class CommonPage {
tagsStringAddTagButtonSubmit = (): Locator =>
this.page.locator('div.popup form[id="tags:string:AddTag"] button[type="submit"]')
- notifyContainerButton = (): Locator => this.page.locator('div.notify-container button[type="button"].small').nth(0)
+ notifyContainerButton = (): Locator => this.page.locator('div.notifyPopup button[data-id="btnNotifyClose"]').first()
errorSpan = (): Locator => this.page.locator('div.ERROR span')
infoSpan = (): Locator => this.page.locator('div.INFO span')
popupSubmitButton = (): Locator => this.page.locator('div.popup button[type="submit"]')
@@ -165,8 +165,10 @@ export class CommonPage {
await this.selectPopupSpanLines(point).click()
}
- async closeNotification (page: Page): Promise {
- await this.notifyContainerButton().click()
+ async closeNotification (): Promise {
+ while (await this.notifyContainerButton().isVisible()) {
+ await this.notifyContainerButton().click()
+ }
}
async checkError (page: Page, errorMessage: string): Promise {
diff --git a/tests/sanity/tests/model/documents/document-content-page.ts b/tests/sanity/tests/model/documents/document-content-page.ts
index 5d6de50ea6..f806ebd5f4 100644
--- a/tests/sanity/tests/model/documents/document-content-page.ts
+++ b/tests/sanity/tests/model/documents/document-content-page.ts
@@ -19,6 +19,8 @@ export class DocumentContentPage extends CommonPage {
readonly buttonMoreActions = (): Locator =>
this.page.locator('div.hulyHeader-buttonsGroup button#btn-doc-title-open-more')
+ readonly buttonLockedInTitle = (): Locator => this.page.getByRole('button', { name: 'Locked' })
+
readonly popupPanel = (): Locator => this.page.locator('div.popupPanel-title')
readonly popupPanelH1 = (): Locator => this.page.locator('div.antiPopup > h1')
@@ -26,6 +28,10 @@ export class DocumentContentPage extends CommonPage {
await expect(this.buttonDocumentTitle()).toHaveValue(title)
}
+ async checkDocumentLocked (): Promise {
+ await expect(this.buttonLockedInTitle()).toBeVisible({ timeout: 1000 })
+ }
+
async addContentToTheNewLine (newContent: string): Promise {
await expect(this.inputContent()).toBeVisible()
await expect(this.inputContent()).toHaveJSProperty('contentEditable', 'true')
diff --git a/tests/sanity/tests/model/documents/documents-page.ts b/tests/sanity/tests/model/documents/documents-page.ts
index 52fb26d215..7f11d1da24 100644
--- a/tests/sanity/tests/model/documents/documents-page.ts
+++ b/tests/sanity/tests/model/documents/documents-page.ts
@@ -20,6 +20,9 @@ export class DocumentsPage extends CommonPage {
readonly buttonCreateDocument = (): Locator =>
this.page.locator('div[data-float="navigator"] button[id="new-document"]')
+ readonly buttonDocument = (name: string): Locator =>
+ this.page.locator('button.hulyNavItem-container > span[class*="label"]', { hasText: name })
+
readonly divTeamspacesParent = (): Locator =>
this.page.locator('div#navGroup-tree-teamspaces').locator('xpath=../button[1]')
@@ -97,7 +100,13 @@ export class DocumentsPage extends CommonPage {
}
async openDocument (name: string): Promise {
- await this.page.locator('button.hulyNavItem-container > span[class*="label"]', { hasText: name }).click()
+ await this.buttonDocument(name).click()
+ }
+
+ async selectMoreActionOfDocument (name: string, popupItem: string): Promise {
+ await this.buttonDocument(name).hover()
+ await this.page.getByRole('button', { name }).getByRole('button').nth(2).click()
+ await this.selectFromDropdown(this.page, popupItem)
}
async openDocumentForTeamspace (spaceName: string, documentName: string): Promise {
diff --git a/tests/sanity/tests/model/inbox.ts/inbox-page.ts b/tests/sanity/tests/model/inbox.ts/inbox-page.ts
index d8ad4a116a..1d456395dd 100644
--- a/tests/sanity/tests/model/inbox.ts/inbox-page.ts
+++ b/tests/sanity/tests/model/inbox.ts/inbox-page.ts
@@ -12,7 +12,7 @@ export class InboxPage {
readonly leftSidePanelOpen = (): Locator => this.page.locator('#btnPAside')
readonly leftSidePanelClose = (): Locator => this.page.locator('#btnPClose')
readonly inboxChat = (text: string): Locator => this.page.getByText(text)
- readonly issueTitle = (issueTitle: string): Locator => this.page.getByTitle(issueTitle)
+ readonly issueTitle = (issueTitle: string): Locator => this.page.getByText(issueTitle).first()
// ACTIONS
@@ -48,6 +48,10 @@ export class InboxPage {
await expect(this.issueTitle(issueTitle)).toBeVisible()
}
+ async clickIssuePresentInInbox (issueTitle: string): Promise {
+ await this.issueTitle(issueTitle).click()
+ }
+
async checkIfInboxChatExists (text: string, exists: boolean): Promise {
if (exists) {
await expect(this.inboxChat(text)).toBeVisible()
diff --git a/tests/sanity/tests/model/team-page.ts b/tests/sanity/tests/model/team-page.ts
index 8bba4f4e29..e4e93cc5ab 100644
--- a/tests/sanity/tests/model/team-page.ts
+++ b/tests/sanity/tests/model/team-page.ts
@@ -16,6 +16,9 @@ export class TeamPage extends CommonPage {
buttonNextDay = (): Locator =>
this.page.locator('div.hulyComponent div.hulyHeader-container .actions button[data-id="btnNext"]')
+ getItemByText = (column: string, title: string): Locator =>
+ this.page.locator('div.hulyComponent div.item', { hasText: column }).locator('div.item', { hasText: title })
+
async checkTeamPageIsOpened (): Promise {
await expect(this.appHeader()).toBeVisible()
}
diff --git a/tests/sanity/tests/model/tracker/issues-details-page.ts b/tests/sanity/tests/model/tracker/issues-details-page.ts
index e1e77c44a3..270646f99b 100644
--- a/tests/sanity/tests/model/tracker/issues-details-page.ts
+++ b/tests/sanity/tests/model/tracker/issues-details-page.ts
@@ -1,6 +1,7 @@
import { expect, type Locator, type Page } from '@playwright/test'
import { CommonTrackerPage } from './common-tracker-page'
import { Issue, NewIssue } from './types'
+import { convertEstimation } from '../../tracker/tracker.utils'
export class IssuesDetailsPage extends CommonTrackerPage {
readonly page: Page
@@ -139,10 +140,10 @@ export class IssuesDetailsPage extends CommonTrackerPage {
await expect(this.buttonComponent()).toHaveText(data.component)
}
if (data.milestone != null) {
- await expect(this.buttonMilestone()).toHaveText(data.milestone)
+ await expect(this.buttonMilestone()).toHaveText(data.milestone === 'No Milestone' ? 'Milestone' : data.milestone)
}
if (data.estimation != null) {
- await expect(this.textEstimation()).toHaveText(data.estimation)
+ await expect(this.textEstimation()).toHaveText(convertEstimation(data.estimation))
}
if (data.parentIssue != null) {
await expect(this.textParentTitle()).toHaveText(data.parentIssue)
diff --git a/tests/sanity/tests/model/tracker/issues-page.ts b/tests/sanity/tests/model/tracker/issues-page.ts
index 869789e494..b44f8068d7 100644
--- a/tests/sanity/tests/model/tracker/issues-page.ts
+++ b/tests/sanity/tests/model/tracker/issues-page.ts
@@ -412,7 +412,7 @@ export class IssuesPage extends CommonTrackerPage {
await this.fillNewIssueForm(data)
await this.clickButtonCreateIssue()
if (closeNotification) {
- await this.closeNotification(this.page)
+ await this.closeNotification()
}
await attachScreenshot(`createdNewIssue-${data.title}.png`, this.page)
}
diff --git a/tests/sanity/tests/model/tracker/template-details-page.ts b/tests/sanity/tests/model/tracker/template-details-page.ts
index 5d14235475..eb44b9bc75 100644
--- a/tests/sanity/tests/model/tracker/template-details-page.ts
+++ b/tests/sanity/tests/model/tracker/template-details-page.ts
@@ -1,6 +1,7 @@
import { expect, type Locator } from '@playwright/test'
import { CommonTrackerPage } from './common-tracker-page'
import { Issue, NewIssue } from './types'
+import { convertEstimation } from '../../tracker/tracker.utils'
export class TemplateDetailsPage extends CommonTrackerPage {
inputTitle = (): Locator => this.page.locator('div.popupPanel-body input[type="text"]')
@@ -34,7 +35,7 @@ export class TemplateDetailsPage extends CommonTrackerPage {
await expect(this.buttonComponent()).toHaveText(data.component)
}
if (data.estimation != null) {
- await expect(this.buttonEstimation()).toHaveText(data.estimation)
+ await expect(this.buttonEstimation()).toHaveText(convertEstimation(data.estimation))
}
}
diff --git a/tests/sanity/tests/planning/plan.spec.ts b/tests/sanity/tests/planning/plan.spec.ts
index 1dfd5ca6d0..9c0c8988b0 100644
--- a/tests/sanity/tests/planning/plan.spec.ts
+++ b/tests/sanity/tests/planning/plan.spec.ts
@@ -1,5 +1,5 @@
import { test } from '@playwright/test'
-import { generateId, PlatformSetting, PlatformURI, generateTestData } from '../utils'
+import { generateId, PlatformSetting, PlatformURI, generateTestData, getTimeForPlanner } from '../utils'
import { PlanningPage } from '../model/planning/planning-page'
import { NewToDo } from '../model/planning/types'
import { PlanningNavigationMenuPage } from '../model/planning/planning-navigation-menu-page'
@@ -179,12 +179,7 @@ test.describe('Planning ToDo tests', () => {
}
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 timeI = `${hour + 1}${ampm}`
+ const time = getTimeForPlanner()
const leftSideMenuPage: LeftSideMenuPage = new LeftSideMenuPage(page)
const loginPage: LoginPage = new LoginPage(page)
diff --git a/tests/sanity/tests/tracker/common-steps.ts b/tests/sanity/tests/tracker/common-steps.ts
index ab53e6a6a3..097f960510 100644
--- a/tests/sanity/tests/tracker/common-steps.ts
+++ b/tests/sanity/tests/tracker/common-steps.ts
@@ -26,7 +26,7 @@ export async function prepareNewIssueWithOpenStep (page: Page, issue: NewIssue):
})
}
-export function createNewIssueData (firstName: string, lastName: string): NewIssue {
+export function createNewIssueData (firstName: string, lastName: string, replace?: object): NewIssue {
return {
title: faker.lorem.words(3),
description: faker.lorem.sentence(),
@@ -39,6 +39,7 @@ export function createNewIssueData (firstName: string, lastName: string): NewIss
estimation: '2',
milestone: 'No Milestone',
duedate: 'today',
- filePath: 'cat.jpeg'
+ filePath: 'cat.jpeg',
+ ...replace
}
}
diff --git a/tests/sanity/tests/tracker/issues.spec.ts b/tests/sanity/tests/tracker/issues.spec.ts
index c32a57ab71..fb0c445f07 100644
--- a/tests/sanity/tests/tracker/issues.spec.ts
+++ b/tests/sanity/tests/tracker/issues.spec.ts
@@ -46,11 +46,7 @@ test.describe('Tracker issue tests', () => {
}
await prepareNewIssueWithOpenStep(page, newIssue)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
})
test('Edit an issue', async ({ page }) => {
@@ -74,34 +70,19 @@ test.describe('Tracker issue tests', () => {
await issuesDetailsPage.checkIssue({
...newIssue,
- ...editIssue,
- estimation: '1d'
+ ...editIssue
})
- const estimations = new Map([
- ['0', '0h'],
- ['1', '1h'],
- ['1.25', '1h 15m'],
- ['1.259', '1h 15m'],
- ['1.26', '1h 15m'],
- ['1.27', '1h 16m'],
- ['1.5', '1h 30m'],
- ['1.75', '1h 45m'],
- ['2', '2h'],
- ['7', '7h'],
- ['8', '1d'],
- ['9', '1d 1h'],
- ['9.5', '1d 1h 30m']
- ])
+ const estimations = ['0', '1', '1.25', '1.259', '1.26', '1.27', '1.5', '1.75', '2', '7', '8', '9', '9.5']
- for (const [input, expected] of estimations.entries()) {
+ for (const input of estimations) {
await issuesDetailsPage.editIssue({
estimation: input
})
await issuesDetailsPage.checkIssue({
...newIssue,
...editIssue,
- estimation: expected
+ estimation: input
})
}
})
@@ -222,7 +203,7 @@ test.describe('Tracker issue tests', () => {
title: `New Issue-${generateId(4)}`,
description: 'New Issue',
priority: 'Medium',
- estimation: '1d',
+ estimation: '8',
component: 'Default component',
milestone: 'Edit Milestone'
}
diff --git a/tests/sanity/tests/tracker/related-issues.spec.ts b/tests/sanity/tests/tracker/related-issues.spec.ts
index d23d8cac0a..b9d399f64e 100644
--- a/tests/sanity/tests/tracker/related-issues.spec.ts
+++ b/tests/sanity/tests/tracker/related-issues.spec.ts
@@ -57,8 +57,6 @@ test.describe('Tracker related issue tests', () => {
await issuesDetailsPage.checkIssue({
...newIssue,
...relatedIssue,
- milestone: 'Milestone',
- estimation: '1d 4h',
relatedIssue: 'TSK'
})
})
diff --git a/tests/sanity/tests/tracker/subissues.spec.ts b/tests/sanity/tests/tracker/subissues.spec.ts
index 6e8298aa2e..c4d998f68b 100644
--- a/tests/sanity/tests/tracker/subissues.spec.ts
+++ b/tests/sanity/tests/tracker/subissues.spec.ts
@@ -94,8 +94,6 @@ test.describe('Tracker sub-issues tests', () => {
await issuesDetailsPage.checkIssue({
...newSubIssue,
...editSubIssue,
- milestone: 'Milestone',
- estimation: '1d',
parentIssue: newIssue.title
})
})
diff --git a/tests/sanity/tests/tracker/template.spec.ts b/tests/sanity/tests/tracker/template.spec.ts
index c379928c09..6b87bc9f49 100644
--- a/tests/sanity/tests/tracker/template.spec.ts
+++ b/tests/sanity/tests/tracker/template.spec.ts
@@ -41,10 +41,7 @@ test.describe('Tracker template tests', () => {
await trackerNavigationMenuPage.openTemplateForProject('Default')
await templatePage.createNewTemplate(newTemplate)
await templatePage.openTemplate(newTemplate.title)
- await templateDetailsPage.checkTemplate({
- ...newTemplate,
- estimation: '2h'
- })
+ await templateDetailsPage.checkTemplate(newTemplate)
})
test('Edit a Template', async ({ page }) => {
@@ -69,36 +66,21 @@ test.describe('Tracker template tests', () => {
await templateDetailsPage.editTemplate(editTemplate)
await templateDetailsPage.checkTemplate({
...newTemplate,
- ...editTemplate,
- estimation: '1d'
+ ...editTemplate
})
await templateDetailsPage.checkActivityContent(`New template: ${newTemplate.title}`)
- const estimations = new Map([
- ['0', '0h'],
- ['1', '1h'],
- ['1.25', '1h 15m'],
- ['1.259', '1h 15m'],
- ['1.26', '1h 15m'],
- ['1.27', '1h 16m'],
- ['1.5', '1h 30m'],
- ['1.75', '1h 45m'],
- ['2', '2h'],
- ['7', '7h'],
- ['8', '1d'],
- ['9', '1d 1h'],
- ['9.5', '1d 1h 30m']
- ])
+ const estimations = ['0', '1', '1.25', '1.259', '1.26', '1.27', '1.5', '1.75', '2', '7', '8', '9', '9.5']
- for (const [input, expected] of estimations.entries()) {
+ for (const input of estimations) {
await templateDetailsPage.editTemplate({
estimation: input
})
await templateDetailsPage.checkTemplate({
...newTemplate,
...editTemplate,
- estimation: expected
+ estimation: input
})
}
})
diff --git a/tests/sanity/tests/tracker/tracker.spec.ts b/tests/sanity/tests/tracker/tracker.spec.ts
index 4529f105e3..b119b24fab 100644
--- a/tests/sanity/tests/tracker/tracker.spec.ts
+++ b/tests/sanity/tests/tracker/tracker.spec.ts
@@ -168,7 +168,7 @@ test.describe('Tracker tests', () => {
status: 'Todo',
priority: 'Urgent',
assignee: 'Appleseed John',
- estimation: '1h',
+ estimation: '1',
dueDate: '24'
})
})
diff --git a/tests/sanity/tests/tracker/tracker.utils.ts b/tests/sanity/tests/tracker/tracker.utils.ts
index a7d271ca0b..c296ba09c0 100644
--- a/tests/sanity/tests/tracker/tracker.utils.ts
+++ b/tests/sanity/tests/tracker/tracker.utils.ts
@@ -204,7 +204,7 @@ export async function checkIssueDraft (page: Page, props: IssueProps): Promise= 11 && hour < 13 ? 11 : hour >= 22 ? 10 : hour > 12 ? hour - 12 : hour
+
+ return `${hour}${ampm}`
+}
+
// Consistent data
export const workspaceName = faker.lorem.word()
export const userName = faker.internet.userName()
diff --git a/tests/sanity/tests/workspace/create.spec.ts b/tests/sanity/tests/workspace/create.spec.ts
index 4e4d2a5936..d51304d485 100644
--- a/tests/sanity/tests/workspace/create.spec.ts
+++ b/tests/sanity/tests/workspace/create.spec.ts
@@ -82,11 +82,7 @@ test.describe('Workspace tests', () => {
await issuesPage.openIssueByName(newIssue.title)
const issuesDetailsPage = new IssuesDetailsPage(page)
- await issuesDetailsPage.checkIssue({
- ...newIssue,
- milestone: 'Milestone',
- estimation: '2h'
- })
+ await issuesDetailsPage.checkIssue(newIssue)
})
test('Check validation steps description for the create flow', async ({ page }) => {