Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}
<ButtonIcon icon={IconMoreH} kind={'tertiary'} size={'extra-small'} pressed={hovered} on:click={onMenuClick} />
<ButtonIcon
icon={IconMoreH}
kind={'tertiary'}
size={'extra-small'}
pressed={hovered}
dataId={'btnDocMore'}
on:click={onMenuClick}
/>
</svelte:fragment>
<svelte:fragment slot="dropbox">
<slot />
Expand Down
4 changes: 2 additions & 2 deletions tests/sanity/tests/chat/chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -424,18 +425,17 @@ 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')
const mentionName = `${newUser2.lastName} ${newUser2.firstName}`
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()
Expand Down
8 changes: 2 additions & 6 deletions tests/sanity/tests/collaborative/issues.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down Expand Up @@ -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()
Expand Down
19 changes: 19 additions & 0 deletions tests/sanity/tests/documents/documents.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})
117 changes: 61 additions & 56 deletions tests/sanity/tests/inbox/inbox.spec.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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
})
Expand All @@ -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)
Expand All @@ -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 }) => {
Expand All @@ -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()
Expand Down Expand Up @@ -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')
Expand All @@ -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()
})
})
8 changes: 5 additions & 3 deletions tests/sanity/tests/model/common-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]')
Expand Down Expand Up @@ -165,8 +165,10 @@ export class CommonPage {
await this.selectPopupSpanLines(point).click()
}

async closeNotification (page: Page): Promise<void> {
await this.notifyContainerButton().click()
async closeNotification (): Promise<void> {
while (await this.notifyContainerButton().isVisible()) {
await this.notifyContainerButton().click()
}
}

async checkError (page: Page, errorMessage: string): Promise<void> {
Expand Down
6 changes: 6 additions & 0 deletions tests/sanity/tests/model/documents/document-content-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ 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')

async checkDocumentTitle (title: string): Promise<void> {
await expect(this.buttonDocumentTitle()).toHaveValue(title)
}

async checkDocumentLocked (): Promise<void> {
await expect(this.buttonLockedInTitle()).toBeVisible({ timeout: 1000 })
}

async addContentToTheNewLine (newContent: string): Promise<string> {
await expect(this.inputContent()).toBeVisible()
await expect(this.inputContent()).toHaveJSProperty('contentEditable', 'true')
Expand Down
11 changes: 10 additions & 1 deletion tests/sanity/tests/model/documents/documents-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]')

Expand Down Expand Up @@ -97,7 +100,13 @@ export class DocumentsPage extends CommonPage {
}

async openDocument (name: string): Promise<void> {
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<void> {
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<void> {
Expand Down
6 changes: 5 additions & 1 deletion tests/sanity/tests/model/inbox.ts/inbox-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -48,6 +48,10 @@ export class InboxPage {
await expect(this.issueTitle(issueTitle)).toBeVisible()
}

async clickIssuePresentInInbox (issueTitle: string): Promise<void> {
await this.issueTitle(issueTitle).click()
}

async checkIfInboxChatExists (text: string, exists: boolean): Promise<void> {
if (exists) {
await expect(this.inboxChat(text)).toBeVisible()
Expand Down
3 changes: 3 additions & 0 deletions tests/sanity/tests/model/team-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
await expect(this.appHeader()).toBeVisible()
}
Expand Down
Loading