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-8626: Add test plans #7421

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
125 changes: 121 additions & 4 deletions models/test-management/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import print from '@hcengineering/model-print'
import tracker from '@hcengineering/model-tracker'
import { type ViewOptionsModel } from '@hcengineering/view'

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

import {
DOMAIN_TEST_MANAGEMENT,
Expand All @@ -38,7 +38,9 @@ import {
TDefaultProjectTypeData,
TTestRun,
TTypeTestRunStatus,
TTestResult
TTestResult,
TTestPlan,
TTestPlanItem
} from './types'

import testManagement from './plugin'
Expand Down Expand Up @@ -99,6 +101,34 @@ function defineApplication (builder: Builder): void {
syncWithLocationQuery: true
}
},
{
id: 'testPlans',
label: testManagement.string.TestPlans,
icon: testManagement.icon.TestPlans,
component: workbench.component.SpecialView,
componentProps: {
_class: testManagement.class.TestPlanItem,
icon: testManagement.icon.TestPlans,
label: testManagement.string.TestPlans,
createButton: testManagement.component.CreateTestPlanButton
},
navigationModel: {
navigationComponent: view.component.FoldersBrowser,
navigationComponentLabel: testManagement.string.TestPlan,
navigationComponentIcon: testManagement.icon.TestPlans,
mainComponentLabel: testManagement.string.TestCase,
mainComponentIcon: testManagement.icon.TestCase,
navigationComponentProps: {
_class: testManagement.class.TestPlan,
icon: testManagement.icon.TestPlans,
title: testManagement.string.TestPlans,
titleKey: 'name',
getFolderLink: testManagement.function.GetTestPlanLink,
plainList: true
},
syncWithLocationQuery: true
}
},
{
id: 'testRuns',
label: testManagement.string.TestRuns,
Expand All @@ -107,7 +137,8 @@ function defineApplication (builder: Builder): void {
componentProps: {
_class: testManagement.class.TestResult,
icon: testManagement.icon.TestRuns,
label: testManagement.string.TestRuns
label: testManagement.string.TestRuns,
createButton: testManagement.component.CreateTestRunButton
},
navigationModel: {
navigationComponent: view.component.FoldersBrowser,
Expand Down Expand Up @@ -148,7 +179,9 @@ export function createModel (builder: Builder): void {
TDefaultProjectTypeData,
TTestRun,
TTypeTestRunStatus,
TTestResult
TTestResult,
TTestPlan,
TTestPlanItem
)

builder.mixin(testManagement.class.TestProject, core.class.Class, activity.mixin.ActivityDoc, {})
Expand All @@ -162,6 +195,7 @@ export function createModel (builder: Builder): void {
defineTestCase(builder)
defineTestRun(builder)
defineTestResult(builder)
defineTestPlan(builder)

definePresenters(builder)

Expand Down Expand Up @@ -530,6 +564,89 @@ function defineTestResult (builder: Builder): void {
},
testManagement.viewlet.TableTestResult
)

const testPlanViewOptions: ViewOptionsModel = {
groupBy: ['testSuite'],
orderBy: [['assignee', SortingOrder.Ascending]],
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.TestPlanItem,
descriptor: view.viewlet.List,
configOptions: {
strict: true
},
config: [
{
key: '$lookup.testCase',
displayProps: { fixed: 'left' },
presenter: testManagement.component.TestCasePresenter
},
{ key: '', displayProps: { grow: true } },
{
key: 'assignee',
props: { kind: 'list', shouldShowName: true, avatarSize: 'x-small', label: testManagement.string.Unassigned },
displayProps: { key: 'assignee', fixed: 'right' }
}
],
viewOptions: testPlanViewOptions,
/* eslint-disable @typescript-eslint/consistent-type-assertions */
options: {
lookup: {
testCase: testManagement.class.TestCase
}
} as FindOptions<TestPlanItem>
},
testManagement.viewlet.TestPlanItemsList
)
}

function defineTestPlan (builder: Builder): void {
builder.mixin(testManagement.class.TestPlan, core.class.Class, activity.mixin.ActivityDoc, {})

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

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

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

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

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

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

export { testManagementOperation } from './migration'
Expand Down
7 changes: 5 additions & 2 deletions models/test-management/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ export default mergeIds(testManagementId, testManganement, {
TestSuitePresenter: '' as AnyComponent,
EditTestSuite: '' as AnyComponent,
EditTestCase: '' as AnyComponent,
CreateTestRun: '' as AnyComponent,
TestRunPresenter: '' as AnyComponent,
EditTestRun: '' as AnyComponent,
TestSuiteRefPresenter: '' as AnyComponent,
RunButton: '' as AnyComponent,
TestResultPresenter: '' as AnyComponent,
EditTestResult: '' as AnyComponent,
TestResultFooter: '' as AnyComponent,
TestRunHeader: '' as AnyComponent
TestRunHeader: '' as AnyComponent,
TestPlanPresenter: '' as AnyComponent,
CreateTestPlanButton: '' as AnyComponent,
TestPlanItemPresenter: '' as AnyComponent,
CreateTestRunButton: '' as AnyComponent
}
})
54 changes: 53 additions & 1 deletion models/test-management/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import type {
TestProject,
TestRun,
TestRunStatus,
TestResult
TestResult,
TestPlan,
TestPlanItem
} from '@hcengineering/test-management'
import { type Attachment } from '@hcengineering/attachment'
import contact from '@hcengineering/contact'
Expand Down Expand Up @@ -267,3 +269,53 @@ export class TTestResult extends TAttachedDoc implements TestResult {
@Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number
}

@Model(testManagement.class.TestPlan, core.class.Doc, DOMAIN_TEST_MANAGEMENT)
@UX(testManagement.string.TestPlan)
export class TTestPlan extends TDoc implements TestPlan {
@Prop(TypeString(), testManagement.string.Name)
@Index(IndexKind.FullText)
name!: string

@Prop(TypeCollaborativeDoc(), testManagement.string.FullDescription)
@Index(IndexKind.FullText)
description!: MarkupBlobRef | null

@Prop(Collection(testManagement.class.TestPlanItem), testManagement.string.TestCase, {
shortLabel: testManagement.string.TestCase
})
results?: CollectionSize<TestPlanItem>
}

@Model(testManagement.class.TestPlanItem, core.class.AttachedDoc, DOMAIN_TEST_MANAGEMENT)
@UX(testManagement.string.TestCase)
export class TTestPlanItem extends TAttachedDoc implements TestPlanItem {
@Prop(TypeRef(testManagement.class.TestPlan), core.string.AttachedTo)
@Index(IndexKind.Indexed)
declare attachedTo: Ref<TestPlan>

@Prop(TypeRef(testManagement.class.TestPlan), core.string.AttachedToClass)
@Index(IndexKind.Indexed)
@Hidden()
declare attachedToClass: Ref<Class<TestPlan>>

@Prop(TypeRef(testManagement.class.TestProject), core.string.Space)
@Index(IndexKind.Indexed)
@Hidden()
declare space: Ref<TestProject>

@Prop(TypeString(), core.string.Collection)
@Hidden()
override collection: 'items' = 'items'

@Prop(TypeRef(testManagement.class.TestCase), testManagement.string.TestCase)
testCase!: Ref<TestCase>

@Prop(TypeRef(testManagement.class.TestSuite), testManagement.string.TestSuite)
@Index(IndexKind.Indexed)
testSuite?: Ref<TestSuite>

@Prop(TypeRef(contact.mixin.Employee), testManagement.string.TestAssignee)
@Index(IndexKind.Indexed)
assignee?: Ref<Employee>
}
3 changes: 1 addition & 2 deletions models/view/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export default mergeIds(viewId, view, {
ImageViewer: '' as AnyComponent,
VideoViewer: '' as AnyComponent,
PDFViewer: '' as AnyComponent,
TextViewer: '' as AnyComponent,
FoldersBrowser: '' as AnyComponent
TextViewer: '' as AnyComponent
},
string: {
Table: '' as IntlString,
Expand Down
1 change: 1 addition & 0 deletions packages/theme/styles/dialogs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
flex-grow: 1;
min-width: 0;
min-height: 0;
overflow: hidden;

&.rounded { border-radius: 0 0 .5rem .5rem; }
&:has(audio) {
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ export { default as ExpandCollapse } from './components/ExpandCollapse.svelte'
export { default as BooleanIcon } from './components/BooleanIcon.svelte'
export { default as Expandable } from './components/Expandable.svelte'
export { default as BarDashboard } from './components/BarDashboard.svelte'
export { default as MultiProgress } from './components/MultiProgress.svelte'
export { default as Notifications } from './components/notifications/Notifications.svelte'
export { default as notificationsStore } from './components/notifications/store'
export { NotificationPosition } from './components/notifications/NotificationPosition'
Expand Down
6 changes: 6 additions & 0 deletions plugins/test-management-assets/assets/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion plugins/test-management-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@
"GoToNextTestTooltip": "Přejít na další test",
"AllTests": "Všechny testy",
"MyTests": "Moje testy",
"Comments": "Komentáře"
"Comments": "Komentáře",
"Cancel": "Zrušit",
"Name": "Název",
"TestPlans": "Plány testování",
"TestPlan": "Plán testování",
"CreateTestPlan": "Vytvořit plán testování",
"SelectedTestCases": "{count, plural, =0 {Testovací případy nevybrány} one {# testovací případ vybrán} few {# testovací případy vybrány} other {# testovacích případů vybráno}}",
"DefaultAssignee": "Výchozí přiřazovatel",
"TestPlanTitle": "Název plánu testování",
"SelectTestCases": "Vyberte testovací případy"
}
}
11 changes: 10 additions & 1 deletion plugins/test-management-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@
"GoToNextTestTooltip": "Go to next test",
"AllTests": "All tests",
"MyTests": "My tests",
"Comments": "Comments"
"Comments": "Comments",
"Cancel": "Cancel",
"Name": "Name",
"TestPlans": "Test plans",
"TestPlan": "Test plan",
"CreateTestPlan": "New test plan",
"SelectedTestCases": "{count, plural, =0 {Test cases not selected} one {# test case selected} few {# test cases selected} other {# test cases selected}}",
"DefaultAssignee": "Default assignee",
"TestPlanTitle": "Test plan title",
"SelectTestCases": "Select test cases"
}
}
11 changes: 10 additions & 1 deletion plugins/test-management-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@
"GoToNextTestTooltip": "Ir al siguiente test",
"AllTests": "Todas las pruebas",
"MyTests": "Mis pruebas",
"Comments": "Comentarios"
"Comments": "Comentarios",
"Cancel": "Cancelar",
"Name": "Nombre",
"TestPlans": "Planes de pruebas",
"TestPlan": "Plan de prueba",
"CreateTestPlan": "Crear planes de prueba",
"SelectedTestCases": "{count, plural, =0 {Casos de prueba no seleccionados} one {# caso de prueba seleccionado} few {# casos de prueba seleccionados} other {# casos de prueba seleccionados}}",
"DefaultAssignee": "Asignado por defecto",
"TestPlanTitle": "Título del plan de prueba",
"SelectTestCases": "Seleccionar casos de prueba"
}
}
11 changes: 10 additions & 1 deletion plugins/test-management-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@
"GoToNextTestTooltip": "Aller au test suivant",
"AllTests": "Tous les tests",
"MyTests": "Mes tests",
"Comments": "Commentaires"
"Comments": "Commentaires",
"Cancel": "Annuler",
"Name": "Nom",
"TestPlans": "Test plans",
"TestPlan": "Test plan",
"CreateTestPlan": "Créer un test plan",
"SelectedTestCases": "{count, plural, =0 {Cas de test non sélectionnés} one {# cas de test sélectionné} few {# cas de test sélectionnés} other {# cas de test sélectionnés}}",
"DefaultAssignee": "Assigné par défaut",
"TestPlanTitle": "Titre",
"SelectTestCases": "Sélectionnez les cas de test"
}
}
11 changes: 10 additions & 1 deletion plugins/test-management-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@
"GoToNextTestTooltip": "Vai al test successivo",
"AllTests": "Tutte le test",
"MyTests": "Le mie test",
"Comments": "Commenti"
"Comments": "Commenti",
"Cancel": "Annulla",
"Name": "Nome",
"TestPlans": "Piani di test",
"TestPlan": "Piano di test",
"CreateTestPlan": "Crea piano di test",
"SelectedTestCases": "{count, plural, =0 {Casi di test non selezionati} one {# caso di test selezionato} few {# casi di test selezionati} other {# casi di test selezionati}}",
"DefaultAssignee": "Assegnatario predefinito",
"TestPlanTitle": "Titolo",
"SelectTestCases": "Seleziona casi di test"
}
}
11 changes: 10 additions & 1 deletion plugins/test-management-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@
"GoToNextTestTooltip": "Ir para o próximo teste",
"AllTests": "Todos os testes",
"MyTests": "Meus testes",
"Comments": "Comentários"
"Comments": "Comentários",
"Cancel": "Cancelar",
"Name": "Nome",
"TestPlans": "Planos de teste",
"TestPlan": "Plano de teste",
"CreateTestPlan": "Criar plano de teste",
"SelectedTestCases": "{count, plural, =0 {Casos de teste não selecionados} one {# caso de teste selecionado} few {# casos de teste selecionados} other {# casos de teste selecionados}}",
"DefaultAssignee": "Responsável padrão",
"TestPlanTitle": "Título",
"SelectTestCases": "Selecionar casos de teste"
}
}
Loading
Loading