Skip to content

Commit

Permalink
feat(tests): TESTS-45 done Move to project test (#4203)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
  • Loading branch information
nestoragent authored Dec 15, 2023
1 parent 868fc0a commit 818a5c8
Show file tree
Hide file tree
Showing 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.
Binary file not shown.
Binary file added tests/sanity-ws/000002/space-1702587939180-0.snp.gz
Binary file not shown.
Binary file not shown.
Binary file added tests/sanity-ws/000002/tx-1702587939180-0.snp.gz
Binary file not shown.
Binary file not shown.
Binary file modified tests/sanity-ws/backup.json.gz
Binary file not shown.
17 changes: 17 additions & 0 deletions tests/sanity/tests/model/tracker/common-tracker-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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> {
Expand Down Expand Up @@ -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 })
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
33 changes: 33 additions & 0 deletions tests/sanity/tests/tracker/issues.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})

0 comments on commit 818a5c8

Please sign in to comment.