-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TESTS-42: feat(tests): done Edit Sub-Issue test (#4191)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
- Loading branch information
1 parent
5d963eb
commit 3b67b0e
Showing
4 changed files
with
115 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { test } from '@playwright/test' | ||
import { allure } from 'allure-playwright' | ||
import { IssuesPage } from '../model/tracker/issues-page' | ||
import { generateId, PlatformSetting, PlatformURI } from '../utils' | ||
import { | ||
checkIssue, | ||
checkIssueDraft, | ||
createIssue, | ||
DEFAULT_STATUSES, | ||
DEFAULT_USER, | ||
fillIssueForm, | ||
navigate | ||
} from './tracker.utils' | ||
import { Issue, NewIssue } from '../model/tracker/types' | ||
import { LeftSideMenuPage } from '../model/left-side-menu-page' | ||
import { IssuesDetailsPage } from '../model/tracker/issues-details-page' | ||
|
||
test.use({ | ||
storageState: PlatformSetting | ||
}) | ||
test.describe('Tracker sub-issues tests', () => { | ||
test.beforeEach(async ({ page }) => { | ||
await allure.parentSuite('Tracker tests') | ||
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished() | ||
}) | ||
|
||
test('create sub-issue', async ({ page }) => { | ||
await navigate(page) | ||
|
||
const props = { | ||
name: `issue-${generateId(5)}`, | ||
description: 'description', | ||
status: DEFAULT_STATUSES[1], | ||
priority: 'Urgent', | ||
assignee: DEFAULT_USER | ||
} | ||
await navigate(page) | ||
await createIssue(page, props) | ||
await page.click('text="Issues"') | ||
|
||
const issuesPage = new IssuesPage(page) | ||
await issuesPage.modelSelectorAll.click() | ||
await issuesPage.searchIssueByName(props.name) | ||
await issuesPage.openIssueByName(props.name) | ||
|
||
await checkIssue(page, props) | ||
props.name = `sub${props.name}` | ||
await page.click('button:has-text("Add sub-issue")') | ||
await fillIssueForm(page, props) | ||
await page.keyboard.press('Escape') | ||
await page.keyboard.press('Escape') | ||
|
||
await page.locator('#new-issue').click() | ||
await checkIssueDraft(page, props) | ||
}) | ||
|
||
test('Edit a sub-issue', async ({ page }) => { | ||
const newIssue: NewIssue = { | ||
title: `Issue for the sub-issue-${generateId()}`, | ||
description: 'Description Issue for the sub-issue' | ||
} | ||
const newSubIssue: NewIssue = { | ||
title: `New Sub-Issue with parameter-${generateId()}`, | ||
description: 'New Description Sub-Issue with parameter' | ||
} | ||
const editSubIssue: Issue = { | ||
status: 'In Progress', | ||
priority: 'Urgent', | ||
assignee: 'Appleseed John', | ||
createLabel: true, | ||
labels: `EDIT-SUB-ISSUE-${generateId()}`, | ||
component: 'No component', | ||
estimation: '8', | ||
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 issuesPage.searchIssueByName(newIssue.title) | ||
await issuesPage.openIssueByName(newIssue.title) | ||
|
||
const issuesDetailsPage = new IssuesDetailsPage(page) | ||
await issuesDetailsPage.buttonAddSubIssue.click() | ||
|
||
await issuesPage.fillNewIssueForm(newSubIssue) | ||
await issuesPage.buttonCreateIssue.click() | ||
await issuesPage.openIssueByName(newSubIssue.title) | ||
|
||
await issuesDetailsPage.waitDetailsOpened(newSubIssue.title) | ||
await issuesDetailsPage.editIssue(editSubIssue) | ||
await issuesDetailsPage.checkIssue({ | ||
...newSubIssue, | ||
...editSubIssue, | ||
milestone: 'Milestone', | ||
estimation: '1d', | ||
parentIssue: newIssue.title | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters