mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-12 20:57:45 +02:00
UBERF-8584: Add test runs (#7235)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright © 2024 Hardcore Engineering Inc.
|
||||
//
|
||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License. You may
|
||||
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
export enum TestManagementEvents {
|
||||
TestCaseCreated = 'testManagement.TestCaseCreated',
|
||||
TestCaseEdited = 'testManagement.TestCaseEdited',
|
||||
TestCaseDeleted = 'testManagement.TestCaseDeleted',
|
||||
TestSuiteCreated = 'testManagement.TestSuiteCreated',
|
||||
TestSuiteEdited = 'testManagement.TestSuiteEdited',
|
||||
TestSuiteDeleted = 'testManagement.TestSuiteDeleted',
|
||||
TestRunCreated = 'testManagement.TestRunCreated',
|
||||
TestRunEdited = 'testManagement.TestRunEdited',
|
||||
TestRunDeleted = 'testManagement.TestRunDeleted'
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
import { testManagementId, testManagementPlugin } from './plugin'
|
||||
|
||||
export * from './types'
|
||||
export * from './analytics'
|
||||
export { testManagementId }
|
||||
|
||||
export default testManagementPlugin
|
||||
|
||||
@@ -28,7 +28,7 @@ import type { Asset, IntlString, Plugin, Resource } from '@hcengineering/platfor
|
||||
import { plugin } from '@hcengineering/platform'
|
||||
import { type AnyComponent, type Location, type ResolvedLocation } from '@hcengineering/ui'
|
||||
|
||||
import { ActionCategory, Viewlet } from '@hcengineering/view'
|
||||
import { Action, ActionCategory, ViewAction, Viewlet } from '@hcengineering/view'
|
||||
import {
|
||||
TestSuite,
|
||||
TestCase,
|
||||
@@ -37,8 +37,8 @@ import {
|
||||
TestCasePriority,
|
||||
TestCaseStatus,
|
||||
TestRun,
|
||||
TestRunItem,
|
||||
TestRunResult
|
||||
TestRunStatus,
|
||||
TestResult
|
||||
} from './types'
|
||||
|
||||
/** @public */
|
||||
@@ -49,6 +49,17 @@ export const testManagementPlugin = plugin(testManagementId, {
|
||||
app: {
|
||||
TestManagement: '' as Ref<Doc>
|
||||
},
|
||||
action: {
|
||||
DeleteTestCase: '' as Ref<Action<Doc, any>>,
|
||||
CreateChildTestSuite: '' as Ref<Action>,
|
||||
EditTestSuite: '' as Ref<Action>,
|
||||
RunSelectedTests: '' as Ref<Action>
|
||||
},
|
||||
actionImpl: {
|
||||
CreateChildTestSuite: '' as ViewAction,
|
||||
EditTestSuite: '' as ViewAction,
|
||||
RunSelectedTests: '' as ViewAction
|
||||
},
|
||||
icon: {
|
||||
TestManagement: '' as Asset,
|
||||
TestManagementVersion: '' as Asset,
|
||||
@@ -68,7 +79,14 @@ export const testManagementPlugin = plugin(testManagementId, {
|
||||
StatusApproved: '' as Asset,
|
||||
StatusRejected: '' as Asset,
|
||||
Document: '' as Asset,
|
||||
TestLibrary: '' as Asset
|
||||
TestLibrary: '' as Asset,
|
||||
TestResult: '' as Asset,
|
||||
StatusNonTested: '' as Asset,
|
||||
StatusBlocked: '' as Asset,
|
||||
StatusPassed: '' as Asset,
|
||||
StatusFailed: '' as Asset,
|
||||
Filter: '' as Asset,
|
||||
Check: '' as Asset
|
||||
},
|
||||
class: {
|
||||
TestCase: '' as Ref<Class<TestCase>>,
|
||||
@@ -78,8 +96,8 @@ export const testManagementPlugin = plugin(testManagementId, {
|
||||
TypeTestCasePriority: '' as Ref<Class<Type<TestCasePriority>>>,
|
||||
TypeTestCaseStatus: '' as Ref<Class<Type<TestCaseStatus>>>,
|
||||
TestRun: '' as Ref<Class<TestRun>>,
|
||||
TestRunItem: '' as Ref<Class<TestRunItem>>,
|
||||
TypeTestRunResult: '' as Ref<Class<Type<TestRunResult>>>
|
||||
TypeTestRunStatus: '' as Ref<Class<Type<TestRunStatus>>>,
|
||||
TestResult: '' as Ref<Class<TestResult>>
|
||||
},
|
||||
descriptors: {
|
||||
ProjectType: '' as Ref<SpaceTypeDescriptor>
|
||||
@@ -150,14 +168,28 @@ export const testManagementPlugin = plugin(testManagementId, {
|
||||
TestRunName: '' as IntlString,
|
||||
NoTestCases: '' as IntlString,
|
||||
DueDate: '' as IntlString,
|
||||
TestRunItems: '' as IntlString,
|
||||
TestRunResult: '' as IntlString,
|
||||
TestRunItem: '' as IntlString,
|
||||
TestRunStatus: '' as IntlString,
|
||||
TestRunNamePlaceholder: '' as IntlString,
|
||||
TestRunResult: '' as IntlString,
|
||||
SelectTestSuites: '' as IntlString,
|
||||
SelectTestCases: '' as IntlString,
|
||||
CreateTestRun: '' as IntlString,
|
||||
TestLibrary: '' as IntlString
|
||||
TestLibrary: '' as IntlString,
|
||||
TestResult: '' as IntlString,
|
||||
StatusNonTested: '' as IntlString,
|
||||
StatusBlocked: '' as IntlString,
|
||||
StatusPassed: '' as IntlString,
|
||||
StatusFailed: '' as IntlString,
|
||||
SelectTestCase: '' as IntlString,
|
||||
Save: '' as IntlString,
|
||||
SaveAndNext: '' as IntlString,
|
||||
DonePercent: '' as IntlString,
|
||||
TestResults: '' as IntlString,
|
||||
RunAllTestCases: '' as IntlString,
|
||||
RunSelectedTestCases: '' as IntlString,
|
||||
RunFilteredTestCases: '' as IntlString,
|
||||
TestCaseDescription: '' as IntlString,
|
||||
TestResultAttributes: '' as IntlString
|
||||
},
|
||||
category: {
|
||||
TestManagement: '' as Ref<ActionCategory>
|
||||
@@ -171,7 +203,12 @@ export const testManagementPlugin = plugin(testManagementId, {
|
||||
PriorityIconPresenter: '' as AnyComponent,
|
||||
TestCaseStatusPresenter: '' as AnyComponent,
|
||||
TestSuites: '' as AnyComponent,
|
||||
CreateTestSuite: '' as AnyComponent
|
||||
CreateTestSuite: '' as AnyComponent,
|
||||
TestRunFromSelection: '' as AnyComponent,
|
||||
TestResultStatusPresenter: '' as AnyComponent,
|
||||
TestResultStatusEditor: '' as AnyComponent,
|
||||
TestRunResult: '' as AnyComponent,
|
||||
TestResultHeader: '' as AnyComponent
|
||||
},
|
||||
ids: {
|
||||
NoParent: '' as Ref<TestSuite>,
|
||||
@@ -193,9 +230,9 @@ export const testManagementPlugin = plugin(testManagementId, {
|
||||
viewlet: {
|
||||
TableTestCase: '' as Ref<Viewlet>,
|
||||
TableTestSuites: '' as Ref<Viewlet>,
|
||||
TableTestRun: '' as Ref<Viewlet>,
|
||||
SuiteTestCases: '' as Ref<Viewlet>,
|
||||
ListTestCase: '' as Ref<Viewlet>
|
||||
ListTestCase: '' as Ref<Viewlet>,
|
||||
TestResultList: '' as Ref<Viewlet>,
|
||||
TableTestResult: '' as Ref<Viewlet>
|
||||
},
|
||||
testCaseTypeStatus: {
|
||||
Draft: '' as Ref<Status>,
|
||||
@@ -207,7 +244,8 @@ export const testManagementPlugin = plugin(testManagementId, {
|
||||
TestCase: '' as Ref<TestCase>
|
||||
},
|
||||
function: {
|
||||
GetTestSuiteLink: '' as Resource<(doc: Ref<Doc>) => Location>
|
||||
GetTestSuiteLink: '' as Resource<(doc: Ref<Doc>) => Location>,
|
||||
GetTestRunLink: '' as Resource<(doc: Ref<Doc>) => Location>
|
||||
},
|
||||
resolver: {
|
||||
Location: '' as Resource<(loc: Location) => Promise<ResolvedLocation | undefined>>
|
||||
|
||||
@@ -103,20 +103,26 @@ export interface TestRun extends Doc {
|
||||
name: string
|
||||
description: CollaborativeDoc
|
||||
dueDate?: Timestamp
|
||||
items?: CollectionSize<TestRunItem>
|
||||
results?: CollectionSize<TestResult>
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export enum TestRunResult {
|
||||
Passed,
|
||||
export enum TestRunStatus {
|
||||
Untested,
|
||||
Blocked,
|
||||
Passed,
|
||||
Failed
|
||||
}
|
||||
|
||||
// TODO: Refactor to associations
|
||||
/** @public */
|
||||
export interface TestRunItem extends AttachedDoc {
|
||||
testRun: Ref<TestRun>
|
||||
export interface TestResult extends AttachedDoc<TestRun, 'results', TestProject> {
|
||||
name: string
|
||||
testCase: Ref<TestCase>
|
||||
result?: TestRunResult
|
||||
testSuite?: Ref<TestSuite>
|
||||
status?: TestRunStatus
|
||||
description: CollaborativeDoc
|
||||
assignee?: Ref<Employee>
|
||||
attachments?: CollectionSize<Attachment>
|
||||
comments?: number
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user