diff --git a/tests/sanity-ws/000001/_migrations-1701980652141-0.snp.gz b/tests/sanity-ws/000001/_migrations-1701980652141-0.snp.gz deleted file mode 100644 index 8ae876ebe72..00000000000 Binary files a/tests/sanity-ws/000001/_migrations-1701980652141-0.snp.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/_migrations-1702322310672-0.snp.gz b/tests/sanity-ws/000001/_migrations-1702322310672-0.snp.gz new file mode 100644 index 00000000000..4578ac8bdd9 Binary files /dev/null and b/tests/sanity-ws/000001/_migrations-1702322310672-0.snp.gz differ diff --git a/tests/sanity-ws/000001/_migrations-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/_migrations-data-1701980652141-1.tar.gz deleted file mode 100644 index 6df8c6fe153..00000000000 Binary files a/tests/sanity-ws/000001/_migrations-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/_migrations-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/_migrations-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..9cd96eebd77 Binary files /dev/null and b/tests/sanity-ws/000001/_migrations-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/attachment-1701980652141-0.snp.gz b/tests/sanity-ws/000001/attachment-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/attachment-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/attachment-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/attachment-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/attachment-data-1701980652141-1.tar.gz deleted file mode 100644 index 4147a0400d1..00000000000 Binary files a/tests/sanity-ws/000001/attachment-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/attachment-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/attachment-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..84a327d5901 Binary files /dev/null and b/tests/sanity-ws/000001/attachment-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/blob-1701980652141-0.snp.gz b/tests/sanity-ws/000001/blob-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/blob-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/blob-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/blob-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/blob-data-1701980652141-1.tar.gz deleted file mode 100644 index 2b19ecfc27b..00000000000 Binary files a/tests/sanity-ws/000001/blob-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/blob-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/blob-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..accd808a78a Binary files /dev/null and b/tests/sanity-ws/000001/blob-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/channel-1701980652141-0.snp.gz b/tests/sanity-ws/000001/channel-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/channel-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/channel-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/channel-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/channel-data-1701980652141-1.tar.gz deleted file mode 100644 index eb41dccca7a..00000000000 Binary files a/tests/sanity-ws/000001/channel-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/channel-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/channel-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..598ebbb3461 Binary files /dev/null and b/tests/sanity-ws/000001/channel-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/chunter-1701980652141-0.snp.gz b/tests/sanity-ws/000001/chunter-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/chunter-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/chunter-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/chunter-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/chunter-data-1701980652141-1.tar.gz deleted file mode 100644 index 02845572cc8..00000000000 Binary files a/tests/sanity-ws/000001/chunter-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/chunter-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/chunter-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..839071132b9 Binary files /dev/null and b/tests/sanity-ws/000001/chunter-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/comment-1701980652141-0.snp.gz b/tests/sanity-ws/000001/comment-1701980652141-0.snp.gz deleted file mode 100644 index 7bc12c003df..00000000000 Binary files a/tests/sanity-ws/000001/comment-1701980652141-0.snp.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/comment-1702322310672-0.snp.gz b/tests/sanity-ws/000001/comment-1702322310672-0.snp.gz new file mode 100644 index 00000000000..b895bab783a Binary files /dev/null and b/tests/sanity-ws/000001/comment-1702322310672-0.snp.gz differ diff --git a/tests/sanity-ws/000001/comment-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/comment-data-1701980652141-1.tar.gz deleted file mode 100644 index dad0bb37612..00000000000 Binary files a/tests/sanity-ws/000001/comment-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/comment-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/comment-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..fd093c88a1d Binary files /dev/null and b/tests/sanity-ws/000001/comment-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/contact-1701980652141-0.snp.gz b/tests/sanity-ws/000001/contact-1701980652141-0.snp.gz deleted file mode 100644 index 51c8255ba30..00000000000 Binary files a/tests/sanity-ws/000001/contact-1701980652141-0.snp.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/contact-1702322310672-0.snp.gz b/tests/sanity-ws/000001/contact-1702322310672-0.snp.gz new file mode 100644 index 00000000000..bc7ecd94464 Binary files /dev/null and b/tests/sanity-ws/000001/contact-1702322310672-0.snp.gz differ diff --git a/tests/sanity-ws/000001/contact-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/contact-data-1701980652141-1.tar.gz deleted file mode 100644 index 50a4a1f490b..00000000000 Binary files a/tests/sanity-ws/000001/contact-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/contact-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/contact-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..6751c298951 Binary files /dev/null and b/tests/sanity-ws/000001/contact-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/doc-index-state-1701980652141-0.snp.gz b/tests/sanity-ws/000001/doc-index-state-1701980652141-0.snp.gz deleted file mode 100644 index 74d660b5d72..00000000000 Binary files a/tests/sanity-ws/000001/doc-index-state-1701980652141-0.snp.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/doc-index-state-1702322310672-0.snp.gz b/tests/sanity-ws/000001/doc-index-state-1702322310672-0.snp.gz new file mode 100644 index 00000000000..42b97ac7345 Binary files /dev/null and b/tests/sanity-ws/000001/doc-index-state-1702322310672-0.snp.gz differ diff --git a/tests/sanity-ws/000001/doc-index-state-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/doc-index-state-data-1701980652141-1.tar.gz deleted file mode 100644 index 893120d0941..00000000000 Binary files a/tests/sanity-ws/000001/doc-index-state-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/doc-index-state-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/doc-index-state-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..4cce02eca71 Binary files /dev/null and b/tests/sanity-ws/000001/doc-index-state-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/fulltext-blob-1701980652141-0.snp.gz b/tests/sanity-ws/000001/fulltext-blob-1701980652141-0.snp.gz deleted file mode 100644 index 218ba909e1b..00000000000 Binary files a/tests/sanity-ws/000001/fulltext-blob-1701980652141-0.snp.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/fulltext-blob-1702322310672-0.snp.gz b/tests/sanity-ws/000001/fulltext-blob-1702322310672-0.snp.gz new file mode 100644 index 00000000000..c7b521e856b Binary files /dev/null and b/tests/sanity-ws/000001/fulltext-blob-1702322310672-0.snp.gz differ diff --git a/tests/sanity-ws/000001/fulltext-blob-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/fulltext-blob-data-1701980652141-1.tar.gz deleted file mode 100644 index 1a48446de7d..00000000000 Binary files a/tests/sanity-ws/000001/fulltext-blob-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/fulltext-blob-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/fulltext-blob-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..6be85894aa8 Binary files /dev/null and b/tests/sanity-ws/000001/fulltext-blob-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/inventory-1701980652141-0.snp.gz b/tests/sanity-ws/000001/inventory-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/inventory-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/inventory-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/inventory-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/inventory-data-1701980652141-1.tar.gz deleted file mode 100644 index c2dee52cf43..00000000000 Binary files a/tests/sanity-ws/000001/inventory-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/inventory-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/inventory-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..71543a8355a Binary files /dev/null and b/tests/sanity-ws/000001/inventory-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/kanban-1701980652141-0.snp.gz b/tests/sanity-ws/000001/kanban-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/kanban-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/kanban-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/kanban-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/kanban-data-1701980652141-1.tar.gz deleted file mode 100644 index 7949dc08fdf..00000000000 Binary files a/tests/sanity-ws/000001/kanban-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/kanban-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/kanban-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..7e6f0ee35fe Binary files /dev/null and b/tests/sanity-ws/000001/kanban-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/notification-1701980652141-0.snp.gz b/tests/sanity-ws/000001/notification-1701980652141-0.snp.gz deleted file mode 100644 index 9782c892e87..00000000000 Binary files a/tests/sanity-ws/000001/notification-1701980652141-0.snp.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/notification-1702322310672-0.snp.gz b/tests/sanity-ws/000001/notification-1702322310672-0.snp.gz new file mode 100644 index 00000000000..92d0ef2c0e7 Binary files /dev/null and b/tests/sanity-ws/000001/notification-1702322310672-0.snp.gz differ diff --git a/tests/sanity-ws/000001/notification-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/notification-data-1701980652141-1.tar.gz deleted file mode 100644 index 802f2b1fcf4..00000000000 Binary files a/tests/sanity-ws/000001/notification-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/notification-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/notification-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..1380e889440 Binary files /dev/null and b/tests/sanity-ws/000001/notification-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/space-1701980652141-0.snp.gz b/tests/sanity-ws/000001/space-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/space-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/space-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/space-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/space-data-1701980652141-1.tar.gz deleted file mode 100644 index aad1efeddee..00000000000 Binary files a/tests/sanity-ws/000001/space-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/space-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/space-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..ec3f6b3be37 Binary files /dev/null and b/tests/sanity-ws/000001/space-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/status-1701980652141-0.snp.gz b/tests/sanity-ws/000001/status-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/status-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/status-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/status-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/status-data-1701980652141-1.tar.gz deleted file mode 100644 index e6a6de534aa..00000000000 Binary files a/tests/sanity-ws/000001/status-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/status-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/status-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..7f482b98e83 Binary files /dev/null and b/tests/sanity-ws/000001/status-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/tags-1701980652141-0.snp.gz b/tests/sanity-ws/000001/tags-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/tags-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/tags-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/tags-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/tags-data-1701980652141-1.tar.gz deleted file mode 100644 index a6f6a827c63..00000000000 Binary files a/tests/sanity-ws/000001/tags-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/tags-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/tags-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..f78c325a0e2 Binary files /dev/null and b/tests/sanity-ws/000001/tags-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/task-1701980652141-0.snp.gz b/tests/sanity-ws/000001/task-1702322310672-0.snp.gz similarity index 100% rename from tests/sanity-ws/000001/task-1701980652141-0.snp.gz rename to tests/sanity-ws/000001/task-1702322310672-0.snp.gz diff --git a/tests/sanity-ws/000001/task-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/task-data-1701980652141-1.tar.gz deleted file mode 100644 index 77ab6747624..00000000000 Binary files a/tests/sanity-ws/000001/task-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/task-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/task-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..b08b32c6805 Binary files /dev/null and b/tests/sanity-ws/000001/task-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/tracker-1701980652141-0.snp.gz b/tests/sanity-ws/000001/tracker-1701980652141-0.snp.gz deleted file mode 100644 index bb373a74767..00000000000 Binary files a/tests/sanity-ws/000001/tracker-1701980652141-0.snp.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/tracker-1702322310672-0.snp.gz b/tests/sanity-ws/000001/tracker-1702322310672-0.snp.gz new file mode 100644 index 00000000000..17152ee6354 Binary files /dev/null and b/tests/sanity-ws/000001/tracker-1702322310672-0.snp.gz differ diff --git a/tests/sanity-ws/000001/tracker-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/tracker-data-1701980652141-1.tar.gz deleted file mode 100644 index 34136885ee8..00000000000 Binary files a/tests/sanity-ws/000001/tracker-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/tracker-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/tracker-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..d63818247fb Binary files /dev/null and b/tests/sanity-ws/000001/tracker-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/000001/tx-1701980652141-0.snp.gz b/tests/sanity-ws/000001/tx-1701980652141-0.snp.gz deleted file mode 100644 index b316ea7dcfa..00000000000 Binary files a/tests/sanity-ws/000001/tx-1701980652141-0.snp.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/tx-1702322310672-0.snp.gz b/tests/sanity-ws/000001/tx-1702322310672-0.snp.gz new file mode 100644 index 00000000000..881a1089f30 Binary files /dev/null and b/tests/sanity-ws/000001/tx-1702322310672-0.snp.gz differ diff --git a/tests/sanity-ws/000001/tx-data-1701980652141-1.tar.gz b/tests/sanity-ws/000001/tx-data-1701980652141-1.tar.gz deleted file mode 100644 index 41b0825ef16..00000000000 Binary files a/tests/sanity-ws/000001/tx-data-1701980652141-1.tar.gz and /dev/null differ diff --git a/tests/sanity-ws/000001/tx-data-1702322310672-1.tar.gz b/tests/sanity-ws/000001/tx-data-1702322310672-1.tar.gz new file mode 100644 index 00000000000..8243b860a07 Binary files /dev/null and b/tests/sanity-ws/000001/tx-data-1702322310672-1.tar.gz differ diff --git a/tests/sanity-ws/backup.json.gz b/tests/sanity-ws/backup.json.gz index d16dec33830..551403bb289 100644 Binary files a/tests/sanity-ws/backup.json.gz and b/tests/sanity-ws/backup.json.gz differ diff --git a/tests/sanity/tests/actions.spec.ts b/tests/sanity/tests/actions.spec.ts index 0665a3688c0..339667231d7 100644 --- a/tests/sanity/tests/actions.spec.ts +++ b/tests/sanity/tests/actions.spec.ts @@ -41,8 +41,8 @@ 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")', { delay: 100 }) + expect(await page.locator('div.selectPopup div.list-item :text("Go To Vacancies")').count()).toBe(1) + await page.click('div.selectPopup div.list-item :text("Go To Vacancies")', { delay: 100 }) await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/vacancies`) }) diff --git a/tests/sanity/tests/model/tracker/common-tracker-page.ts b/tests/sanity/tests/model/tracker/common-tracker-page.ts index 095cb3d014a..616012f1215 100644 --- a/tests/sanity/tests/model/tracker/common-tracker-page.ts +++ b/tests/sanity/tests/model/tracker/common-tracker-page.ts @@ -4,11 +4,19 @@ import { CalendarPage } from '../calendar-page' export class CommonTrackerPage extends CalendarPage { readonly page: Page readonly buttonFilter: Locator + readonly inputComment: Locator + readonly buttonSendComment: Locator + readonly textComment: Locator + readonly textActivity: Locator constructor (page: Page) { super(page) this.page = page this.buttonFilter = page.locator('div.search-start > div:first-child button') + this.inputComment = page.locator('div.text-input div.tiptap') + this.buttonSendComment = page.locator('g#Send') + this.textComment = page.locator('div.showMore-content p') + this.textActivity = page.locator('div.header') } async selectFilter (filter: string, filterSecondLevel?: string): Promise { @@ -58,4 +66,17 @@ export class CommonTrackerPage extends CalendarPage { await this.page.locator('div.date-popup-container button[type="submit"]').click({ delay: 100 }) } + + async addComment (comment: string): Promise { + await this.inputComment.fill(comment) + await this.buttonSendComment.click() + } + + async checkCommentExist (comment: string): Promise { + await expect(this.textComment.filter({ hasText: comment })).toBeVisible() + } + + async checkActivityExist (activity: string): Promise { + await expect(this.textActivity.filter({ hasText: activity })).toBeVisible() + } } diff --git a/tests/sanity/tests/model/tracker/milestones-details-page.ts b/tests/sanity/tests/model/tracker/milestones-details-page.ts index 1235c661c8e..fbdabdc3493 100644 --- a/tests/sanity/tests/model/tracker/milestones-details-page.ts +++ b/tests/sanity/tests/model/tracker/milestones-details-page.ts @@ -1,13 +1,53 @@ -import { type Locator, type Page } from '@playwright/test' +import { expect, type Locator, type Page } from '@playwright/test' import { CommonTrackerPage } from './common-tracker-page' +import { NewMilestone } from './types' export class MilestonesDetailsPage extends CommonTrackerPage { readonly page: Page readonly inputTitle: Locator + readonly buttonStatus: Locator + readonly buttonTargetDate: Locator + readonly inputMilestoneName: Locator + readonly inputDescription: Locator constructor (page: Page) { super(page) this.page = page this.inputTitle = page.locator('div.popupPanel-body input[type="text"]') + this.buttonStatus = page.locator('//span[text()="Status"]/following-sibling::div[1]/button') + this.buttonTargetDate = page.locator('//span[text()="Target date"]/following-sibling::div[1]/button') + this.inputMilestoneName = page.locator('input[placeholder="Milestone name"]') + this.inputDescription = page.locator('div.inputMsg div.tiptap') + } + + async checkIssue (data: NewMilestone): Promise { + await expect(this.inputTitle).toHaveValue(data.name) + if (data.description != null) { + await expect(this.inputDescription).toHaveText(data.description) + } + if (data.status != null) { + await expect(this.buttonStatus).toHaveText(data.status) + } + } + + async editIssue (data: NewMilestone): Promise { + if (data.name != null) { + await this.inputTitle.fill(data.name) + } + if (data.description != null) { + await this.inputDescription.fill(data.description) + } + if (data.status != null) { + await this.buttonStatus.click() + await this.selectFromDropdown(this.page, data.status) + } + if (data.targetDate != null) { + await this.buttonTargetDate.click() + await this.fillDatePopup(data.targetDate.day, data.targetDate.month, data.targetDate.year) + } + if (data.targetDateInDays != null) { + await this.buttonTargetDate.click() + await this.fillDatePopupInDays(data.targetDateInDays) + } } } diff --git a/tests/sanity/tests/tracker/milestone.spec.ts b/tests/sanity/tests/tracker/milestone.spec.ts index c43dd8532f6..05d72e9b464 100644 --- a/tests/sanity/tests/tracker/milestone.spec.ts +++ b/tests/sanity/tests/tracker/milestone.spec.ts @@ -1,4 +1,4 @@ -import { expect, test } from '@playwright/test' +import { test } from '@playwright/test' import { generateId, PlatformSetting, PlatformURI } from '../utils' import { allure } from 'allure-playwright' import { LeftSideMenuPage } from '../model/left-side-menu-page' @@ -36,6 +36,36 @@ test.describe('Tracker milestone tests', () => { await milestonesPage.openMilestoneByName(newMilestone.name) const milestonesDetailsPage = new MilestonesDetailsPage(page) - await expect(milestonesDetailsPage.inputTitle).toHaveValue(newMilestone.name) + await milestonesDetailsPage.checkIssue(newMilestone) + }) + + test('Edit a Milestone', async ({ page }) => { + const commentText: 'Edit Milestone comment' = 'Edit Milestone comment' + const editMilestone: NewMilestone = { + name: 'Edit Milestone', + description: 'Edit Milestone Description', + status: 'Completed', + targetDateInDays: 'in 30 days' + } + + const leftSideMenuPage = new LeftSideMenuPage(page) + await leftSideMenuPage.buttonTracker.click() + + const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page) + await trackerNavigationMenuPage.openMilestonesForProject('Default') + + const milestonesPage = new MilestonesPage(page) + await milestonesPage.openMilestoneByName(editMilestone.name) + + const milestonesDetailsPage = new MilestonesDetailsPage(page) + await milestonesDetailsPage.editIssue(editMilestone) + await milestonesDetailsPage.checkIssue(editMilestone) + + await milestonesDetailsPage.addComment(commentText) + await milestonesDetailsPage.checkCommentExist(commentText) + await milestonesDetailsPage.checkActivityExist('created milestone') + await milestonesDetailsPage.checkActivityExist('changed target date in') + await milestonesDetailsPage.checkActivityExist('changed status in') + await milestonesDetailsPage.checkActivityExist('changed description in') }) })