diff --git a/tests/sanity-ws/000002/doc-index-state-1702401246034-0.snp.gz b/tests/sanity-ws/000002/doc-index-state-1702401246034-0.snp.gz new file mode 100644 index 0000000000..1e780641f8 Binary files /dev/null and b/tests/sanity-ws/000002/doc-index-state-1702401246034-0.snp.gz differ diff --git a/tests/sanity-ws/000002/doc-index-state-data-1702401246034-1.tar.gz b/tests/sanity-ws/000002/doc-index-state-data-1702401246034-1.tar.gz new file mode 100644 index 0000000000..e75b4e9cb7 Binary files /dev/null and b/tests/sanity-ws/000002/doc-index-state-data-1702401246034-1.tar.gz differ diff --git a/tests/sanity-ws/000002/fulltext-blob-1702401246034-0.snp.gz b/tests/sanity-ws/000002/fulltext-blob-1702401246034-0.snp.gz new file mode 100644 index 0000000000..2b7207f4fc Binary files /dev/null and b/tests/sanity-ws/000002/fulltext-blob-1702401246034-0.snp.gz differ diff --git a/tests/sanity-ws/000002/fulltext-blob-data-1702401246034-1.tar.gz b/tests/sanity-ws/000002/fulltext-blob-data-1702401246034-1.tar.gz new file mode 100644 index 0000000000..89d87f8294 Binary files /dev/null and b/tests/sanity-ws/000002/fulltext-blob-data-1702401246034-1.tar.gz differ diff --git a/tests/sanity-ws/000002/notification-1702401246034-0.snp.gz b/tests/sanity-ws/000002/notification-1702401246034-0.snp.gz new file mode 100644 index 0000000000..3a6e4ed72c Binary files /dev/null and b/tests/sanity-ws/000002/notification-1702401246034-0.snp.gz differ diff --git a/tests/sanity-ws/000002/notification-data-1702401246034-1.tar.gz b/tests/sanity-ws/000002/notification-data-1702401246034-1.tar.gz new file mode 100644 index 0000000000..baa3688661 Binary files /dev/null and b/tests/sanity-ws/000002/notification-data-1702401246034-1.tar.gz differ diff --git a/tests/sanity-ws/000002/tracker-1702401246034-0.snp.gz b/tests/sanity-ws/000002/tracker-1702401246034-0.snp.gz new file mode 100644 index 0000000000..7f0882e45a Binary files /dev/null and b/tests/sanity-ws/000002/tracker-1702401246034-0.snp.gz differ diff --git a/tests/sanity-ws/000002/tracker-data-1702401246034-1.tar.gz b/tests/sanity-ws/000002/tracker-data-1702401246034-1.tar.gz new file mode 100644 index 0000000000..87bc1ccaa8 Binary files /dev/null and b/tests/sanity-ws/000002/tracker-data-1702401246034-1.tar.gz differ diff --git a/tests/sanity-ws/000002/tx-1702401246034-0.snp.gz b/tests/sanity-ws/000002/tx-1702401246034-0.snp.gz new file mode 100644 index 0000000000..d900fc233c Binary files /dev/null and b/tests/sanity-ws/000002/tx-1702401246034-0.snp.gz differ diff --git a/tests/sanity-ws/000002/tx-data-1702401246034-1.tar.gz b/tests/sanity-ws/000002/tx-data-1702401246034-1.tar.gz new file mode 100644 index 0000000000..ab2acae4d0 Binary files /dev/null and b/tests/sanity-ws/000002/tx-data-1702401246034-1.tar.gz differ diff --git a/tests/sanity-ws/backup.json.gz b/tests/sanity-ws/backup.json.gz index 551403bb28..b8d6cc5902 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/model/tracker/milestones-details-page.ts b/tests/sanity/tests/model/tracker/milestones-details-page.ts index fbdabdc349..604f9daf72 100644 --- a/tests/sanity/tests/model/tracker/milestones-details-page.ts +++ b/tests/sanity/tests/model/tracker/milestones-details-page.ts @@ -9,6 +9,9 @@ export class MilestonesDetailsPage extends CommonTrackerPage { readonly buttonTargetDate: Locator readonly inputMilestoneName: Locator readonly inputDescription: Locator + readonly buttonMoreActions: Locator + readonly buttonYesMoveAndDeleteMilestonePopup: Locator + readonly buttonModalOk: Locator constructor (page: Page) { super(page) @@ -18,6 +21,11 @@ export class MilestonesDetailsPage extends CommonTrackerPage { 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') + this.buttonMoreActions = page.locator('div.popupPanel-title > div:last-child > button:first-child') + this.buttonYesMoveAndDeleteMilestonePopup = page.locator( + 'form[id="tracker:string:MoveAndDeleteMilestone"] button.primary' + ) + this.buttonModalOk = page.locator('div.popup div.footer button:first-child span', { hasText: 'Ok' }) } async checkIssue (data: NewMilestone): Promise { @@ -50,4 +58,11 @@ export class MilestonesDetailsPage extends CommonTrackerPage { await this.fillDatePopupInDays(data.targetDateInDays) } } + + async deleteMilestone (): Promise { + await this.buttonMoreActions.click() + await this.selectFromDropdown(this.page, 'Delete') + await this.buttonYesMoveAndDeleteMilestonePopup.click() + await this.buttonModalOk.click() + } } diff --git a/tests/sanity/tests/model/tracker/milestones-page.ts b/tests/sanity/tests/model/tracker/milestones-page.ts index dfd7781375..a891dac652 100644 --- a/tests/sanity/tests/model/tracker/milestones-page.ts +++ b/tests/sanity/tests/model/tracker/milestones-page.ts @@ -1,4 +1,4 @@ -import { type Locator, type Page } from '@playwright/test' +import { expect, type Locator, type Page } from '@playwright/test' import { NewMilestone } from './types' import { CommonTrackerPage } from './common-tracker-page' @@ -59,4 +59,8 @@ export class MilestonesPage extends CommonTrackerPage { async openMilestoneByName (milestoneName: string): Promise { await this.page.locator('div.listGrid a', { hasText: milestoneName }).click() } + + async checkMilestoneNotExist (milestoneName: string): Promise { + await expect(this.page.locator('div.listGrid a', { hasText: milestoneName })).toHaveCount(0) + } } diff --git a/tests/sanity/tests/tracker/milestone.spec.ts b/tests/sanity/tests/tracker/milestone.spec.ts index 05d72e9b46..558a88fe8e 100644 --- a/tests/sanity/tests/tracker/milestone.spec.ts +++ b/tests/sanity/tests/tracker/milestone.spec.ts @@ -40,7 +40,7 @@ test.describe('Tracker milestone tests', () => { }) test('Edit a Milestone', async ({ page }) => { - const commentText: 'Edit Milestone comment' = 'Edit Milestone comment' + const commentText = 'Edit Milestone comment' const editMilestone: NewMilestone = { name: 'Edit Milestone', description: 'Edit Milestone Description', @@ -68,4 +68,27 @@ test.describe('Tracker milestone tests', () => { await milestonesDetailsPage.checkActivityExist('changed status in') await milestonesDetailsPage.checkActivityExist('changed description in') }) + + test('Delete a Milestone', async ({ page }) => { + const deleteMilestone: NewMilestone = { + name: 'Delete Milestone', + description: 'Delete Milestone Description', + status: 'Canceled' + } + + 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(deleteMilestone.name) + + const milestonesDetailsPage = new MilestonesDetailsPage(page) + await milestonesDetailsPage.checkIssue(deleteMilestone) + await milestonesDetailsPage.deleteMilestone() + + await milestonesPage.checkMilestoneNotExist(deleteMilestone.name) + }) })