Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UBERF-8584: Add test runs #7235

Merged
merged 26 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
02fd0ff
UBERF-8584: Support test run creation
ArtyomSavchenko Nov 16, 2024
0ca8f20
UBERF-8584: Draft test results
ArtyomSavchenko Nov 18, 2024
681c431
Merge branch 'develop' of https://github.com/hcengineering/platform i…
ArtyomSavchenko Nov 18, 2024
11c5c66
UBERF-8584: Draft test runs
ArtyomSavchenko Nov 19, 2024
71e9c64
UBERF-8584: Implement test runs
ArtyomSavchenko Nov 19, 2024
e1750a5
UBERF-8584: Test run details
ArtyomSavchenko Nov 19, 2024
2fb0610
UBERF-8584: Draft test run results
ArtyomSavchenko Nov 20, 2024
00b49d3
UBERF-8584: Redesign test run page and refactor folders
ArtyomSavchenko Nov 21, 2024
599dd78
UBERF-8584: Get rid of multiple test results
ArtyomSavchenko Nov 21, 2024
fefc34c
UBERF-8584: Test result presenter
ArtyomSavchenko Nov 22, 2024
a03eaf9
Merge branch 'develop' of https://github.com/hcengineering/platform i…
ArtyomSavchenko Nov 22, 2024
970e67a
UBERF-8584: Add test result and filters
ArtyomSavchenko Nov 23, 2024
debcdd9
UBERF-8584: Test result presenter
ArtyomSavchenko Nov 25, 2024
0c693b5
UBERF-8584: Test run details
ArtyomSavchenko Nov 25, 2024
55ae5a0
UBERF-8584: Test case select
ArtyomSavchenko Nov 26, 2024
4ee4929
UBERF-8584: Minor improvements and fixes
ArtyomSavchenko Nov 26, 2024
4860ed5
UBERF-8584: Add ability to run all test cases
ArtyomSavchenko Nov 27, 2024
390fa54
Merge branch 'develop' of https://github.com/hcengineering/platform i…
ArtyomSavchenko Nov 27, 2024
2a96fa0
UBERF-8584: Update locales
ArtyomSavchenko Nov 27, 2024
720bcda
UBERF-8584: Run selected tests and fix translations
ArtyomSavchenko Nov 27, 2024
444a270
UBERF-8584: Cleanup code
ArtyomSavchenko Nov 27, 2024
1cdc600
UBERF-8584: Merge with develop
ArtyomSavchenko Nov 27, 2024
9d64328
UBERF-8584: Minor fixes
ArtyomSavchenko Nov 28, 2024
c790bb9
UBERF-8584: Fix right panels
ArtyomSavchenko Nov 28, 2024
59964b6
UBERF-8584: Add test result comments
ArtyomSavchenko Nov 28, 2024
a47a9a5
UBERF-8584: Minor fixes
ArtyomSavchenko Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions models/test-management/src/defaultTypes.ts

This file was deleted.

197 changes: 151 additions & 46 deletions models/test-management/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import activity from '@hcengineering/activity'
import chunter from '@hcengineering/chunter'
import core from '@hcengineering/model-core'
import { SortingOrder } from '@hcengineering/core'
import { SortingOrder, type FindOptions } from '@hcengineering/core'

import { type Builder } from '@hcengineering/model'
import view, { createAction } from '@hcengineering/model-view'
Expand All @@ -25,7 +25,7 @@ import print from '@hcengineering/model-print'
import tracker from '@hcengineering/model-tracker'
import { type ViewOptionsModel } from '@hcengineering/view'

import { testManagementId } from '@hcengineering/test-management'
import { testManagementId, type TestResult } from '@hcengineering/test-management'

import {
DOMAIN_TEST_MANAGEMENT,
Expand All @@ -37,8 +37,8 @@ import {
TTestCase,
TDefaultProjectTypeData,
TTestRun,
TTypeTestRunResult,
TTestRunItem
TTypeTestRunStatus,
TTestResult
} from './types'

import testManagement from './plugin'
Expand All @@ -55,7 +55,6 @@ function defineApplication (builder: Builder): void {
icon: testManagement.icon.TestManagementApplication,
alias: testManagementId,
hidden: false,
locationResolver: testManagement.resolver.Location,
navigatorModel: {
spaces: [
{
Expand Down Expand Up @@ -85,6 +84,7 @@ function defineApplication (builder: Builder): void {
mainComponentLabel: testManagement.string.TestCases,
mainComponentIcon: testManagement.icon.TestCases,
createComponent: testManagement.component.CreateTestSuite,
mainHeaderComponent: testManagement.component.RunSelectedTestsButton,
navigationComponentProps: {
_class: testManagement.class.TestSuite,
icon: testManagement.icon.TestSuites,
Expand All @@ -100,21 +100,34 @@ function defineApplication (builder: Builder): void {
},
syncWithLocationQuery: true
}
}
/* TODO: UBERF-8584
},
{
id: opt.testRunsId,
id: 'testRuns',
label: testManagement.string.TestRuns,
icon: testManagement.icon.TestRuns,
component: workbench.component.SpecialView,
componentProps: {
_class: testManagement.class.TestRun,
_class: testManagement.class.TestResult,
icon: testManagement.icon.TestRuns,
title: testManagement.string.TestRuns,
createLabel: testManagement.string.NewTestRun,
createComponent: testManagement.component.CreateTestRun
label: testManagement.string.TestRuns
},
navigationModel: {
navigationComponent: view.component.FoldersBrowser,
navigationComponentLabel: testManagement.string.TestRun,
navigationComponentIcon: testManagement.icon.TestRuns,
mainComponentLabel: testManagement.string.TestResults,
mainComponentIcon: testManagement.icon.TestResult,
navigationComponentProps: {
_class: testManagement.class.TestRun,
icon: testManagement.icon.TestRuns,
title: testManagement.string.TestSuites,
titleKey: 'name',
getFolderLink: testManagement.function.GetTestRunLink,
plainList: true
},
syncWithLocationQuery: true
}
} */
}
]
}
]
Expand All @@ -135,8 +148,8 @@ export function createModel (builder: Builder): void {
TTestCase,
TDefaultProjectTypeData,
TTestRun,
TTestRunItem,
TTypeTestRunResult
TTypeTestRunStatus,
TTestResult
)

builder.mixin(testManagement.class.TestProject, core.class.Class, activity.mixin.ActivityDoc, {})
Expand Down Expand Up @@ -204,7 +217,7 @@ function defineSpaceType (builder: Builder): void {
core.class.SpaceType,
core.space.Model,
{
name: 'Default project type',
name: 'Default Test Management',
descriptor: testManagement.descriptors.ProjectType,
roles: 0,
targetClass: testManagement.mixin.DefaultProjectTypeData
Expand Down Expand Up @@ -250,13 +263,7 @@ function defineTestSuite (builder: Builder): void {
// Actions

builder.mixin(testManagement.class.TestSuite, core.class.Class, view.mixin.IgnoreActions, {
actions: [
view.action.Open,
view.action.OpenInNewTab,
print.action.Print,
tracker.action.EditRelatedTargets,
tracker.action.NewRelatedIssue
]
actions: [print.action.Print, tracker.action.EditRelatedTargets]
})

createAction(
Expand All @@ -276,6 +283,24 @@ function defineTestSuite (builder: Builder): void {
},
testManagement.action.CreateChildTestSuite
)

createAction(
builder,
{
action: testManagement.actionImpl.RunSelectedTests,
label: testManagement.string.CreateTestRun,
icon: testManagement.icon.TestRuns,
category: testManagement.category.TestCase,
input: 'selection',
target: testManagement.class.TestCase,
context: {
mode: ['context'],
application: testManagement.app.TestManagement,
group: 'create'
}
},
testManagement.action.RunSelectedTests
)
}

function defineTestCase (builder: Builder): void {
Expand Down Expand Up @@ -306,6 +331,11 @@ function defineTestCase (builder: Builder): void {
presenter: testManagement.component.TestSuiteRefPresenter
})

builder.mixin(testManagement.class.TestCase, core.class.Class, view.mixin.ClassFilters, {
filters: ['priority', 'status'],
ignoreKeys: ['createdBy', 'modifiedBy', 'createdOn', 'modifiedOn']
})

builder.createDoc(
view.class.Viewlet,
core.space.Model,
Expand Down Expand Up @@ -350,6 +380,7 @@ function defineTestCase (builder: Builder): void {
hiddenKeys: ['title']
},
config: [
{ key: '', displayProps: { fixed: 'left' } },
{
key: 'status',
props: { kind: 'list', size: 'small', shouldShowName: false },
Expand All @@ -368,21 +399,6 @@ function defineTestCase (builder: Builder): void {
},
testManagement.viewlet.ListTestCase
)

builder.createDoc(
view.class.Viewlet,
core.space.Model,
{
attachTo: testManagement.class.TestCase,
descriptor: view.viewlet.Table,
config: ['', 'assignee', 'modifiedOn'],
configOptions: {
sortable: true
},
variant: 'short'
},
testManagement.viewlet.SuiteTestCases
)
}

function defineTestRun (builder: Builder): void {
Expand All @@ -393,10 +409,6 @@ function defineTestRun (builder: Builder): void {
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.mixin(testManagement.class.TestRun, core.class.Class, view.mixin.ObjectEditor, {
editor: testManagement.component.EditTestRun
})

builder.mixin(testManagement.class.TestRun, core.class.Class, view.mixin.ObjectPanel, {
component: testManagement.component.EditTestRun
})
Expand All @@ -405,18 +417,111 @@ function defineTestRun (builder: Builder): void {
presenter: testManagement.component.TestRunPresenter
})

builder.mixin(testManagement.class.TestRun, core.class.Class, view.mixin.ObjectIcon, {
component: testManagement.component.TestResultStatusPresenter
})

builder.mixin(testManagement.class.TestResult, core.class.Class, view.mixin.ObjectPresenter, {
presenter: testManagement.component.TestResultPresenter
})

builder.mixin(testManagement.class.TestResult, core.class.Class, activity.mixin.ActivityDoc, {})

builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: testManagement.class.TestResult,
components: { input: { component: chunter.component.ChatMessageInput } }
})

builder.mixin(testManagement.class.TestResult, core.class.Class, view.mixin.ObjectEditor, {
editor: testManagement.component.EditTestResult
})

builder.mixin(testManagement.class.TestResult, core.class.Class, view.mixin.ObjectEditorHeader, {
editor: testManagement.component.TestResultHeader
})

builder.mixin(testManagement.class.TestResult, core.class.Class, view.mixin.ObjectPanel, {
component: testManagement.component.EditTestResult
})

builder.mixin(testManagement.class.TestResult, core.class.Class, view.mixin.ObjectPanelFooter, {
editor: testManagement.component.TestResultFooter
})

builder.mixin(testManagement.class.TestResult, core.class.Class, view.mixin.ClassFilters, {
filters: ['assignee', 'status', 'testSuite'],
ignoreKeys: ['createdBy', 'modifiedBy', 'createdOn', 'modifiedOn']
})

const viewOptions: ViewOptionsModel = {
groupBy: ['testSuite'],
orderBy: [
['status', SortingOrder.Ascending],
['modifiedOn', SortingOrder.Descending],
['createdOn', SortingOrder.Descending]
],
other: [
{
key: 'shouldShowAll',
type: 'toggle',
defaultValue: false,
actionTarget: 'category',
action: view.function.ShowEmptyGroups,
label: view.string.ShowEmptyGroups
}
]
}

builder.createDoc(
view.class.Viewlet,
core.space.Model,
{
attachTo: testManagement.class.TestRun,
attachTo: testManagement.class.TestResult,
descriptor: view.viewlet.List,
configOptions: {
strict: true,
hiddenKeys: ['title', 'status', 'modifiedOn']
},
config: [
{ key: '', displayProps: { fixed: 'left' } },
{
key: 'status',
props: { kind: 'list', size: 'small', shouldShowName: false }
},
{
key: 'assignee',
props: { kind: 'list', shouldShowName: false, avatarSize: 'x-small' },
displayProps: { key: 'assignee', fixed: 'right' }
}
],
viewOptions,
/* eslint-disable @typescript-eslint/consistent-type-assertions */
options: {
lookup: {
testCase: testManagement.class.TestCase
}
} as FindOptions<TestResult>
},
testManagement.viewlet.TestResultList
)

builder.createDoc(
view.class.Viewlet,
core.space.Model,
{
attachTo: testManagement.class.TestResult,
descriptor: view.viewlet.Table,
config: [''],
config: ['', 'testSuite', 'status', 'assignee'],
configOptions: {
strict: true
}
},
options: {
lookup: {
testCase: testManagement.class.TestCase
}
} as FindOptions<TestResult>
},
testManagement.viewlet.TableTestRun
testManagement.viewlet.TableTestResult
)
}

Expand Down
Loading