mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 20:25:56 +03:00
feat(tests): TESTS-93 updated Created date filter test (#4862)
Signed-off-by: Alex Velichko <alex@hardcoreeng.com>
This commit is contained in:
parent
643015a664
commit
164a258f75
@ -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
|
BIN
tests/sanity-ws/000007/activity-1709473575430-0.snp.gz
Normal file
BIN
tests/sanity-ws/000007/activity-1709473575430-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/activity-data-1709473575430-1.tar.gz
Normal file
BIN
tests/sanity-ws/000007/activity-data-1709473575430-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/doc-index-state-1709473575430-0.snp.gz
Normal file
BIN
tests/sanity-ws/000007/doc-index-state-1709473575430-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000007/fulltext-blob-1709473575430-0.snp.gz
Normal file
BIN
tests/sanity-ws/000007/fulltext-blob-1709473575430-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/fulltext-blob-data-1709473575430-1.tar.gz
Normal file
BIN
tests/sanity-ws/000007/fulltext-blob-data-1709473575430-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/space-1709473575430-0.snp.gz
Normal file
BIN
tests/sanity-ws/000007/space-1709473575430-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/space-data-1709473575430-1.tar.gz
Normal file
BIN
tests/sanity-ws/000007/space-data-1709473575430-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/task-1709473575430-0.snp.gz
Normal file
BIN
tests/sanity-ws/000007/task-1709473575430-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/task-data-1709473575430-1.tar.gz
Normal file
BIN
tests/sanity-ws/000007/task-data-1709473575430-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/tx-1709473575430-0.snp.gz
Normal file
BIN
tests/sanity-ws/000007/tx-1709473575430-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000007/tx-data-1709473575430-1.tar.gz
Normal file
BIN
tests/sanity-ws/000007/tx-data-1709473575430-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
@ -59,17 +59,25 @@ export class CommonTrackerPage extends CalendarPage {
|
||||
}
|
||||
}
|
||||
|
||||
async updateFilterDimension (filterSecondLevel: string, dateStart?: string): Promise<void> {
|
||||
async updateFilterDimension (
|
||||
filterSecondLevel: string,
|
||||
dateStart?: string,
|
||||
needToOpenCalendar: boolean = false
|
||||
): Promise<void> {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
@ -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 () => {
|
||||
|
Loading…
Reference in New Issue
Block a user