Split save-view-options test to two (#6020)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-07-08 16:10:06 +07:00 committed by GitHub
parent e07f01bf94
commit 8eea8f8ccd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,6 @@
import { test } from '@playwright/test'
import { CommonTrackerPage } from '../model/tracker/common-tracker-page'
import { IssuesDetailsPage } from '../model/tracker/issues-details-page'
import { IssuesPage } from '../model/tracker/issues-page'
import { PlatformSetting, fillSearch } from '../utils'
import {
@ -6,13 +8,11 @@ import {
ViewletSelectors,
checkIssueDraft,
createIssue,
getIssueName,
navigate,
openIssue,
performPanelTest,
getIssueName
performPanelTest
} from './tracker.utils'
import { IssuesDetailsPage } from '../model/tracker/issues-details-page'
import { CommonTrackerPage } from '../model/tracker/common-tracker-page'
test.use({
storageState: PlatformSetting
})
@ -35,19 +35,20 @@ test.describe('Tracker tests', () => {
}
})
test('save-view-options', async ({ page }) => {
test('save-view-options-board', async ({ page }) => {
const panels = ['Issues', 'Active', 'Backlog']
const commonTrackerPage = new CommonTrackerPage(page)
await navigate(page)
for (const viewletSelector of [ViewletSelectors.Board, ViewletSelectors.Table]) {
for (const panel of panels) {
await commonTrackerPage.selectPanelAndViewlet(panel, viewletSelector)
await commonTrackerPage.openViewOptionsAndSelectAssignee()
}
for (const panel of panels) {
await commonTrackerPage.verifyViewOption(panel, viewletSelector)
}
}
await doSaveViewTest(panels, commonTrackerPage, ViewletSelectors.Board)
})
test('save-view-options-table', async ({ page }) => {
const panels = ['Issues', 'Active', 'Backlog']
const commonTrackerPage = new CommonTrackerPage(page)
await navigate(page)
await doSaveViewTest(panels, commonTrackerPage, ViewletSelectors.Table)
})
test('my-issues', async ({ page }) => {
@ -169,3 +170,16 @@ test.describe('Tracker tests', () => {
})
})
})
async function doSaveViewTest (
panels: string[],
commonTrackerPage: CommonTrackerPage,
viewletSelector: ViewletSelectors
): Promise<void> {
for (const panel of panels) {
await commonTrackerPage.selectPanelAndViewlet(panel, viewletSelector)
await commonTrackerPage.openViewOptionsAndSelectAssignee()
}
for (const panel of panels) {
await commonTrackerPage.verifyViewOption(panel, viewletSelector)
}
}