feat(tests): TESTS-45 done Move to project test (#4203)

Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
Alex Velichko 2023-12-15 10:21:41 +03:00 committed by GitHub
parent 868fc0aed6
commit 818a5c829a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 56 additions and 3 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,6 +8,9 @@ export class CommonTrackerPage extends CalendarPage {
readonly buttonSendComment: Locator
readonly textComment: Locator
readonly textActivity: Locator
readonly buttonSpaceSelectorMoveIssuesModal: Locator
readonly buttonMoveIssuesModal: Locator
readonly buttonKeepOriginalMoveIssuesModal: Locator
constructor (page: Page) {
super(page)
@ -17,6 +20,11 @@ export class CommonTrackerPage extends CalendarPage {
this.buttonSendComment = page.locator('g#Send')
this.textComment = page.locator('div.showMore-content p')
this.textActivity = page.locator('div.header')
this.buttonSpaceSelectorMoveIssuesModal = page.locator(
'form[id="tracker:string:MoveIssues"] button[id="space.selector"]'
)
this.buttonMoveIssuesModal = page.locator('form[id="tracker:string:MoveIssues"] button[type="submit"]')
this.buttonKeepOriginalMoveIssuesModal = page.locator('form[id="tracker:string:MoveIssues"] span.toggle-switch')
}
async selectFilter (filter: string, filterSecondLevel?: string): Promise<void> {
@ -79,4 +87,13 @@ export class CommonTrackerPage extends CalendarPage {
async checkActivityExist (activity: string): Promise<void> {
await expect(this.textActivity.filter({ hasText: activity })).toBeVisible()
}
async fillMoveIssuesModal (newProjectName: string, keepOriginalAttributes: boolean = false): Promise<void> {
await this.buttonSpaceSelectorMoveIssuesModal.click()
await this.selectMenuItem(this.page, newProjectName)
if (keepOriginalAttributes) {
await this.buttonKeepOriginalMoveIssuesModal.click()
}
await this.buttonMoveIssuesModal.click({ timeout: 100 })
}
}

View File

@ -36,9 +36,12 @@ export class TrackerNavigationMenuPage extends CommonPage {
async openIssuesForProject (projectName: string): Promise<void> {
await this.page
.locator(`div[class*="antiNav-element"] a[href$="issues"][href*="${projectName}"]> div > span`, {
hasText: 'Issues'
})
.locator(
`xpath=//div[contains(@class, "parent")]/span[text()="${projectName}"]/../following-sibling::div[1]/a[contains(@href, "issues")]`,
{
hasText: 'Issues'
}
)
.click()
}

View File

@ -193,4 +193,37 @@ test.describe('Tracker issue tests', () => {
await issuesPage.checkParentIssue(newIssue.title, parentIssue.title)
})
})
test('Move to project', async ({ page }) => {
const secondProjectName = 'Second Project'
const moveIssue: NewIssue = {
title: `Issue to another project-${generateId()}`,
description: 'Issue to move to another project'
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openIssuesForProject('Default')
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll.click()
await issuesPage.createNewIssue(moveIssue)
await issuesPage.searchIssueByName(moveIssue.title)
await issuesPage.openIssueByName(moveIssue.title)
const issuesDetailsPage = new IssuesDetailsPage(page)
await issuesDetailsPage.moreActionOnIssue('Move to project')
await issuesDetailsPage.fillMoveIssuesModal(secondProjectName, true)
await trackerNavigationMenuPage.openIssuesForProject(secondProjectName)
await issuesPage.openIssueByName(moveIssue.title)
await issuesDetailsPage.checkIssue({
...moveIssue
})
// await issuesDetailsPage.checkActivityExist('changed project in')
// await issuesDetailsPage.checkActivityExist('changed number in')
})
})