diff --git a/tests/restore-workspace.sh b/tests/restore-workspace.sh index f20bc59c982..d7c5ae7b1cb 100755 --- a/tests/restore-workspace.sh +++ b/tests/restore-workspace.sh @@ -11,3 +11,6 @@ ./tool.sh configure sanity-ws --enable=* ./tool.sh configure sanity-ws --list + +# setup issue createdOn for yesterday +./tool.sh change-field sanity-ws --objectId 65e47f1f1b875b51e3b4b983 --objectClass tracker:class:Issue --attribute createdOn --value $(($(date +%s)*1000 - 86400000)) --type number --domain task \ No newline at end of file diff --git a/tests/sanity-ws/000007/activity-1709473575430-0.snp.gz b/tests/sanity-ws/000007/activity-1709473575430-0.snp.gz new file mode 100644 index 00000000000..f44751e4a42 Binary files /dev/null and b/tests/sanity-ws/000007/activity-1709473575430-0.snp.gz differ diff --git a/tests/sanity-ws/000007/activity-data-1709473575430-1.tar.gz b/tests/sanity-ws/000007/activity-data-1709473575430-1.tar.gz new file mode 100644 index 00000000000..aa32b7cb562 Binary files /dev/null and b/tests/sanity-ws/000007/activity-data-1709473575430-1.tar.gz differ diff --git a/tests/sanity-ws/000007/doc-index-state-1709473575430-0.snp.gz b/tests/sanity-ws/000007/doc-index-state-1709473575430-0.snp.gz new file mode 100644 index 00000000000..a61bcd9e5e5 Binary files /dev/null and b/tests/sanity-ws/000007/doc-index-state-1709473575430-0.snp.gz differ diff --git a/tests/sanity-ws/000007/doc-index-state-data-1709473575430-1.tar.gz b/tests/sanity-ws/000007/doc-index-state-data-1709473575430-1.tar.gz new file mode 100644 index 00000000000..61e8d06f119 Binary files /dev/null and b/tests/sanity-ws/000007/doc-index-state-data-1709473575430-1.tar.gz differ diff --git a/tests/sanity-ws/000007/fulltext-blob-1709473575430-0.snp.gz b/tests/sanity-ws/000007/fulltext-blob-1709473575430-0.snp.gz new file mode 100644 index 00000000000..2ee7f365d33 Binary files /dev/null and b/tests/sanity-ws/000007/fulltext-blob-1709473575430-0.snp.gz differ diff --git a/tests/sanity-ws/000007/fulltext-blob-data-1709473575430-1.tar.gz b/tests/sanity-ws/000007/fulltext-blob-data-1709473575430-1.tar.gz new file mode 100644 index 00000000000..b6f6c98b8db Binary files /dev/null and b/tests/sanity-ws/000007/fulltext-blob-data-1709473575430-1.tar.gz differ diff --git a/tests/sanity-ws/000007/space-1709473575430-0.snp.gz b/tests/sanity-ws/000007/space-1709473575430-0.snp.gz new file mode 100644 index 00000000000..35761d6899e Binary files /dev/null and b/tests/sanity-ws/000007/space-1709473575430-0.snp.gz differ diff --git a/tests/sanity-ws/000007/space-data-1709473575430-1.tar.gz b/tests/sanity-ws/000007/space-data-1709473575430-1.tar.gz new file mode 100644 index 00000000000..dcb79205fc3 Binary files /dev/null and b/tests/sanity-ws/000007/space-data-1709473575430-1.tar.gz differ diff --git a/tests/sanity-ws/000007/task-1709473575430-0.snp.gz b/tests/sanity-ws/000007/task-1709473575430-0.snp.gz new file mode 100644 index 00000000000..8d04f0e3aa0 Binary files /dev/null and b/tests/sanity-ws/000007/task-1709473575430-0.snp.gz differ diff --git a/tests/sanity-ws/000007/task-data-1709473575430-1.tar.gz b/tests/sanity-ws/000007/task-data-1709473575430-1.tar.gz new file mode 100644 index 00000000000..3d53b22579e Binary files /dev/null and b/tests/sanity-ws/000007/task-data-1709473575430-1.tar.gz differ diff --git a/tests/sanity-ws/000007/tx-1709473575430-0.snp.gz b/tests/sanity-ws/000007/tx-1709473575430-0.snp.gz new file mode 100644 index 00000000000..1df2a3bbfb1 Binary files /dev/null and b/tests/sanity-ws/000007/tx-1709473575430-0.snp.gz differ diff --git a/tests/sanity-ws/000007/tx-data-1709473575430-1.tar.gz b/tests/sanity-ws/000007/tx-data-1709473575430-1.tar.gz new file mode 100644 index 00000000000..76b71d92260 Binary files /dev/null and b/tests/sanity-ws/000007/tx-data-1709473575430-1.tar.gz differ diff --git a/tests/sanity-ws/backup.json.gz b/tests/sanity-ws/backup.json.gz index 0ff851845c5..1980781df77 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/common-tracker-page.ts b/tests/sanity/tests/model/tracker/common-tracker-page.ts index 4921ac8c664..169da659f46 100644 --- a/tests/sanity/tests/model/tracker/common-tracker-page.ts +++ b/tests/sanity/tests/model/tracker/common-tracker-page.ts @@ -59,17 +59,25 @@ export class CommonTrackerPage extends CalendarPage { } } - async updateFilterDimension (filterSecondLevel: string, dateStart?: string): Promise { + async updateFilterDimension ( + filterSecondLevel: string, + dateStart?: string, + needToOpenCalendar: boolean = false + ): Promise { await this.page.locator('div.filter-section button:nth-child(2)').click() await this.page.locator('div.selectPopup [class*="menu"]', { hasText: filterSecondLevel }).click() if (dateStart !== undefined) { + if (needToOpenCalendar) { + await this.page.locator('div.filter-section button:nth-child(3)').click() + } + switch (dateStart) { case 'Today': await this.page.locator('div.popup div.calendar button.day.today').click() break default: - await this.page.locator('div.popup div.calendar button.day', { hasText: dateStart }).click() + await this.page.locator('div.popup div.calendar button.day').locator(`text="${dateStart}"`).click() break } } diff --git a/tests/sanity/tests/tracker/filter.spec.ts b/tests/sanity/tests/tracker/filter.spec.ts index e38c7c7c7c9..8ee5a9ebea7 100644 --- a/tests/sanity/tests/tracker/filter.spec.ts +++ b/tests/sanity/tests/tracker/filter.spec.ts @@ -112,6 +112,7 @@ test.describe('Tracker filters tests', () => { }) test('Created date', async ({ page }) => { + const yesterdayIssueTitle = 'Issue for the Check Filter Yesterday' const newIssue: NewIssue = { title: `Issue for the Created filter-${generateId()}`, description: 'Issue for the Created filter', @@ -138,12 +139,14 @@ test.describe('Tracker filters tests', () => { await issuesPage.checkFilter('Created date', 'Today') await issuesPage.checkFilteredIssueExist(newIssue.title) + await issuesPage.checkFilteredIssueNotExist(yesterdayIssueTitle) }) await test.step('Check Filter Yesterday', async () => { await issuesPage.updateFilterDimension('Yesterday') await issuesPage.checkFilter('Created date', 'Yesterday') + await issuesPage.checkFilteredIssueExist(yesterdayIssueTitle) await issuesPage.checkFilteredIssueNotExist(newIssue.title) }) @@ -152,6 +155,7 @@ test.describe('Tracker filters tests', () => { await issuesPage.checkFilter('Created date', 'This week') await issuesPage.checkFilteredIssueExist(newIssue.title) + await issuesPage.checkFilteredIssueExist(yesterdayIssueTitle) }) await test.step('Check Filter This month', async () => { @@ -159,13 +163,25 @@ test.describe('Tracker filters tests', () => { await issuesPage.checkFilter('Created date', 'This month') await issuesPage.checkFilteredIssueExist(newIssue.title) + await issuesPage.checkFilteredIssueExist(yesterdayIssueTitle) + }) + + await test.step('Check Filter Exact date - Yesterday', async () => { + const dateYesterday = new Date() + dateYesterday.setDate(dateYesterday.getDate() - 1) + await issuesPage.updateFilterDimension('Exact date', dateYesterday.getDate().toString()) + await issuesPage.checkFilter('Created date', 'is', dateYesterday.getDate().toString()) + + await issuesPage.checkFilteredIssueExist(yesterdayIssueTitle) + await issuesPage.checkFilteredIssueNotExist(newIssue.title) }) await test.step('Check Filter Exact date - Today', async () => { - await issuesPage.updateFilterDimension('Exact date', 'Today') + await issuesPage.updateFilterDimension('Exact date', 'Today', true) await issuesPage.checkFilter('Created date', 'is', 'Today') await issuesPage.checkFilteredIssueExist(newIssue.title) + await issuesPage.checkFilteredIssueNotExist(yesterdayIssueTitle) }) await test.step('Check Filter Before date - Today', async () => {