mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00:00
feat(tests): updated flaky tests (#4244)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
parent
fd5766ba5c
commit
829474e7fb
@ -19,7 +19,7 @@ test.describe('Collaborative test for issue', () => {
|
||||
|
||||
test('Issues can be assigned to another users', async ({ page, browser }) => {
|
||||
const newIssue: NewIssue = {
|
||||
title: 'Issues can be assigned to another users',
|
||||
title: `Issues can be assigned to another users-${generateId()}`,
|
||||
description: 'Issues can be assigned to another users',
|
||||
status: 'Backlog',
|
||||
priority: 'Urgent',
|
||||
|
@ -27,6 +27,7 @@ export class CommonPage {
|
||||
}
|
||||
|
||||
async fillToSelectPopup (page: Page, input: string): Promise<void> {
|
||||
await expect(page.locator('div.selectPopup input')).toBeVisible()
|
||||
await page.locator('div.selectPopup input').fill(input)
|
||||
await page.locator('div.selectPopup button').click()
|
||||
}
|
||||
@ -72,4 +73,8 @@ export class CommonPage {
|
||||
await page.locator('div.selectPopup input').fill(point)
|
||||
await page.locator('div.selectPopup span[class^="lines"]', { hasText: point }).click()
|
||||
}
|
||||
|
||||
async closeNotification (page: Page): Promise<void> {
|
||||
await page.locator('div.notify-container button[type="button"].small').nth(0).click()
|
||||
}
|
||||
}
|
||||
|
@ -74,10 +74,13 @@ export class IssuesPage extends CommonTrackerPage {
|
||||
)
|
||||
}
|
||||
|
||||
async createNewIssue (data: NewIssue): Promise<void> {
|
||||
async createNewIssue (data: NewIssue, closeNotification: boolean = true): Promise<void> {
|
||||
await this.buttonCreateNewIssue.click()
|
||||
await this.fillNewIssueForm(data)
|
||||
await this.buttonCreateIssue.click()
|
||||
if (closeNotification) {
|
||||
await this.closeNotification(this.page)
|
||||
}
|
||||
}
|
||||
|
||||
async fillNewIssueForm (data: NewIssue): Promise<void> {
|
||||
@ -184,7 +187,7 @@ export class IssuesPage extends CommonTrackerPage {
|
||||
}
|
||||
}
|
||||
|
||||
async getIssueId (issueLabel: string, position: number = 1): Promise<string> {
|
||||
async getIssueId (issueLabel: string, position: number = 0): Promise<string> {
|
||||
const id = await this.page.locator(`span[title="${issueLabel}"].overflow-label`).nth(position).textContent()
|
||||
return id?.trim() ?? ''
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ test.describe('Tracker duplicate issue tests', () => {
|
||||
const firstIssueId = await issuesPage.getIssueId(firstIssue.title)
|
||||
|
||||
await issuesPage.createNewIssue(secondIssue)
|
||||
const secondIssueId = await issuesPage.getIssueId(secondIssue.title, 2)
|
||||
const secondIssueId = await issuesPage.getIssueId(secondIssue.title, 1)
|
||||
|
||||
expect(firstIssueId).not.toEqual(secondIssueId)
|
||||
await issuesPage.checkIssuesCount(firstIssue.title, 2)
|
||||
|
Loading…
Reference in New Issue
Block a user