feat(tests): done TESTS-93 (#4110)

This commit is contained in:
Alex Velichko 2023-11-30 07:20:36 +03:00 committed by GitHub
parent f23d061869
commit d40f27b68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 104 additions and 5 deletions

View File

@ -53,7 +53,12 @@ test.describe('actions tests', () => {
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/talents`)
await page.press('body', 'Meta+k')
await page.fill('[placeholder="Search\\ or\\ run\\ a\\ command\\.\\.\\."]', 'go to')
await expect(page.locator('input.actionsInput')).toBeVisible()
await expect(page.locator('div.actionsitem div', { hasText: 'Merge contacts' })).toBeVisible()
await page.click('div.actionsHeader input.actionsInput')
await page.type('div.actionsHeader input.actionsInput', 'go to ')
expect(await page.locator('div.selectPopup :text("Go To Applications")').count()).toBe(1)
await page.click('div.selectPopup :text("Go To Applications")')

View File

@ -17,13 +17,12 @@ test.describe('Tracker filters tests', () => {
test('Modified date', async ({ page }) => {
const newIssue: NewIssue = {
title: `Issue for the filter-${generateId()}`,
description: 'Issue for the filter',
title: `Issue for the Modified filter-${generateId()}`,
description: 'Issue for the Modified filter',
status: 'In Progress',
priority: 'Urgent',
assignee: 'Appleseed John',
createLabel: true,
labels: `FILTER-ISSUE-${generateId()}`,
component: 'No component',
estimation: '2',
milestone: 'No Milestone',
@ -87,7 +86,7 @@ test.describe('Tracker filters tests', () => {
await issuesPage.checkFilteredIssueExist(newIssue.title)
})
await test.step('Check Filter Today', async () => {
await test.step('Check Filter Check Filter Between Dates', async () => {
await issuesPage.updateFilterDimension('Between dates')
const dateYesterday = new Date()
dateYesterday.setDate(dateYesterday.getDate() - 1)
@ -110,4 +109,99 @@ test.describe('Tracker filters tests', () => {
await issuesPage.checkFilteredIssueExist(newIssue.title)
})
})
test('Created date', async ({ page }) => {
const newIssue: NewIssue = {
title: `Issue for the Created filter-${generateId()}`,
description: 'Issue for the Created filter',
status: 'In Progress',
priority: 'Urgent',
assignee: 'Appleseed John',
createLabel: true,
component: 'No component',
estimation: '2',
milestone: 'No Milestone',
duedate: 'today',
filePath: 'cat.jpeg'
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll.click()
await issuesPage.createNewIssue(newIssue)
await test.step('Check Filter Today', async () => {
await issuesPage.selectFilter('Created date', 'Today')
await issuesPage.checkFilter('Created date', 'Today')
await issuesPage.checkFilteredIssueExist(newIssue.title)
})
await test.step('Check Filter Yesterday', async () => {
await issuesPage.updateFilterDimension('Yesterday')
await issuesPage.checkFilter('Created date', 'Yesterday')
await issuesPage.checkFilteredIssueNotExist(newIssue.title)
})
await test.step('Check Filter This week', async () => {
await issuesPage.updateFilterDimension('This week')
await issuesPage.checkFilter('Created date', 'This week')
await issuesPage.checkFilteredIssueExist(newIssue.title)
})
await test.step('Check Filter This month', async () => {
await issuesPage.updateFilterDimension('This month')
await issuesPage.checkFilter('Created date', 'This month')
await issuesPage.checkFilteredIssueExist(newIssue.title)
})
await test.step('Check Filter Exact date - Today', async () => {
await issuesPage.updateFilterDimension('Exact date', 'Today')
await issuesPage.checkFilter('Created date', 'is', 'Today')
await issuesPage.checkFilteredIssueExist(newIssue.title)
})
await test.step('Check Filter Before date - Today', async () => {
await issuesPage.updateFilterDimension('Before date')
await issuesPage.checkFilter('Created date', 'Before', 'Today')
await issuesPage.checkFilteredIssueNotExist(newIssue.title)
})
await test.step('Check Filter After date - Today', async () => {
await issuesPage.updateFilterDimension('After date')
await issuesPage.checkFilter('Created date', 'After', 'Today')
await issuesPage.checkFilteredIssueExist(newIssue.title)
})
await test.step('Check Filter Between Dates', async () => {
await issuesPage.updateFilterDimension('Between dates')
const dateYesterday = new Date()
dateYesterday.setDate(dateYesterday.getDate() - 1)
const dateTomorrow = new Date()
dateTomorrow.setDate(dateTomorrow.getDate() + 1)
const dateYesterdayString = `${dateYesterday.getDate().toString().padStart(2, '0')}${(
dateYesterday.getMonth() + 1
)
.toString()
.padStart(2, '0')}${dateYesterday.getFullYear()}`
const dateTomorrowString = `${dateTomorrow.getDate().toString().padStart(2, '0')}${(dateTomorrow.getMonth() + 1)
.toString()
.padStart(2, '0')}${dateTomorrow.getFullYear()}`
await issuesPage.fillBetweenDate(dateYesterdayString, dateTomorrowString)
await issuesPage.checkFilter('Created date', 'is between', dateYesterday.getDate().toString())
await issuesPage.checkFilter('Created date', 'is between', dateTomorrow.getDate().toString())
await issuesPage.checkFilteredIssueExist(newIssue.title)
})
})
})