TESTS-26: feat(tests): done Archive Project tests (#4157)

Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
Alex Velichko 2023-12-07 10:27:47 +03:00 committed by GitHub
parent e540913376
commit 8e7d0e584f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 4 deletions

View File

@ -57,4 +57,9 @@ export class CommonPage {
async checkExistNewNotification (page: Page): Promise<void> {
await expect(page.locator('button[id$="Inbox"] > div.noty')).toBeVisible()
}
async pressYesForPopup (page: Page): Promise<void> {
await expect(page.locator('div.popup button[type="submit"]')).toBeVisible()
await page.locator('div.popup button[type="submit"]').click()
}
}

View File

@ -40,13 +40,13 @@ export class TrackerNavigationMenuPage extends CommonPage {
await this.page.locator(`a[href$="issues"][href*="${projectName}"]`).click()
}
async openProjectToEdit (projectName: string): Promise<void> {
async makeActionWithProject (projectName: string, action: string): Promise<void> {
await this.buttonProjectsParent.filter({ hasText: projectName }).hover()
await this.buttonProjectsParent
.filter({ hasText: projectName })
.locator('xpath=..')
.locator('div[class*="tool"]:not([class*="arrow"])')
.click()
await this.selectFromDropdown(this.page, 'Edit project')
await this.selectFromDropdown(this.page, action)
}
}

View File

@ -63,13 +63,37 @@ test.describe('Tracker Projects tests', () => {
await newProjectPage.createNewProject(editProjectData)
await trackerNavigationMenuPage.checkProjectExist(editProjectData.title)
await trackerNavigationMenuPage.openProjectToEdit(editProjectData.title)
await trackerNavigationMenuPage.makeActionWithProject(editProjectData.title, 'Edit project')
const editProjectPage = new EditProjectPage(page)
await editProjectPage.checkProject(editProjectData)
await editProjectPage.updateProject(updateProjectData)
await trackerNavigationMenuPage.openProjectToEdit(updateProjectData.title)
await trackerNavigationMenuPage.makeActionWithProject(updateProjectData.title, 'Edit project')
await editProjectPage.checkProject(updateProjectData)
})
test('Archive Project', async ({ page }) => {
const archiveProjectData: NewProject = {
title: 'PROJECT_ARCHIVE',
identifier: 'ARCH',
description: 'Archive Project description',
private: true,
defaultAssigneeForIssues: 'Dirak Kainin',
defaultIssueStatus: 'In Progress'
}
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.checkProjectNotExist(archiveProjectData.title)
await trackerNavigationMenuPage.pressCreateProjectButton()
const newProjectPage = new NewProjectPage(page)
await newProjectPage.createNewProject(archiveProjectData)
await trackerNavigationMenuPage.checkProjectExist(archiveProjectData.title)
await trackerNavigationMenuPage.makeActionWithProject(archiveProjectData.title, 'Archive')
await trackerNavigationMenuPage.pressYesForPopup(page)
await trackerNavigationMenuPage.checkProjectNotExist(archiveProjectData.title)
})
})