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 8ae876ebe7..0000000000 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 0000000000..4578ac8bdd 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 6df8c6fe15..0000000000 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 0000000000..9cd96eebd7 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 4147a0400d..0000000000 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 0000000000..84a327d590 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 2b19ecfc27..0000000000 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 0000000000..accd808a78 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 eb41dccca7..0000000000 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 0000000000..598ebbb346 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 02845572cc..0000000000 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 0000000000..839071132b 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 7bc12c003d..0000000000 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 0000000000..b895bab783 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 dad0bb3761..0000000000 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 0000000000..fd093c88a1 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 51c8255ba3..0000000000 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 0000000000..bc7ecd9446 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 50a4a1f490..0000000000 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 0000000000..6751c29895 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 74d660b5d7..0000000000 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 0000000000..42b97ac734 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 893120d094..0000000000 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 0000000000..4cce02eca7 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 218ba909e1..0000000000 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 0000000000..c7b521e856 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 1a48446de7..0000000000 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 0000000000..6be85894aa 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 c2dee52cf4..0000000000 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 0000000000..71543a8355 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 7949dc08fd..0000000000 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 0000000000..7e6f0ee35f 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 9782c892e8..0000000000 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 0000000000..92d0ef2c0e 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 802f2b1fcf..0000000000 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 0000000000..1380e88944 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 aad1efedde..0000000000 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 0000000000..ec3f6b3be3 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 e6a6de534a..0000000000 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 0000000000..7f482b98e8 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 a6f6a827c6..0000000000 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 0000000000..f78c325a0e 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 77ab674762..0000000000 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 0000000000..b08b32c680 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 bb373a7476..0000000000 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 0000000000..17152ee635 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 34136885ee..0000000000 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 0000000000..d63818247f 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 b316ea7dcf..0000000000 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 0000000000..881a1089f3 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 41b0825ef1..0000000000 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 0000000000..8243b860a0 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 d16dec3383..551403bb28 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 0665a3688c..339667231d 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 095cb3d014..616012f121 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 1235c661c8..fbdabdc349 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 c43dd8532f..05d72e9b46 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') }) })