diff --git a/test-track/backend/src/main/java/io/metersphere/controller/remote/TrackApiTestController.java b/test-track/backend/src/main/java/io/metersphere/controller/remote/TrackApiTestController.java index e274bdd290..6f91d52ad5 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/remote/TrackApiTestController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/remote/TrackApiTestController.java @@ -20,7 +20,8 @@ import javax.servlet.http.HttpServletRequest; "/api/project", "/test/case/relevance/api", "/test/case/relevance/scenario", - "home" + "/share/api/definition", + "/home" }) public class TrackApiTestController { @Resource diff --git a/test-track/frontend/src/api/ui-report.js b/test-track/frontend/src/api/ui-report.js new file mode 100644 index 0000000000..ca2ed888a4 --- /dev/null +++ b/test-track/frontend/src/api/ui-report.js @@ -0,0 +1,21 @@ +import {get, post} from "metersphere-frontend/src/plugins/request" + +export function getScenarioReport(reportId) { + return reportId ? get('/ui/scenario/report/get/' + reportId) : {}; +} + +export function getScenarioReportAll(reportId) { + return reportId ? get('/ui/scenario/report/getAll/' + reportId) : {}; +} + +export function getApiReport(testId) { + return testId ? get('/api/definition/report/getReport/' + testId) : {}; +} + +export function getShareApiReport(shareId, testId) { + return testId ? get('/share/api/definition/report/getReport/' + shareId + '/' + testId) : {}; +} + +export function getShareScenarioReport(shareId, reportId) { + return reportId ? get('/share/ui/scenario/report/get/' + shareId + '/' + reportId) : {}; +} diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/component/UiScenarioResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/component/UiScenarioResult.vue index 95f5d330c2..caab4e0b9e 100644 --- a/test-track/frontend/src/business/plan/view/comonents/report/detail/component/UiScenarioResult.vue +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/component/UiScenarioResult.vue @@ -49,10 +49,11 @@ - + - + +
{{ $t('test_track.plan.load_case.content_empty') }}
+ + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/AssertionResults.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/AssertionResults.vue new file mode 100644 index 0000000000..1b3ee1d6d6 --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/AssertionResults.vue @@ -0,0 +1,99 @@ + + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/MetricChart.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/MetricChart.vue new file mode 100644 index 0000000000..385050b8f6 --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/MetricChart.vue @@ -0,0 +1,481 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResult.vue new file mode 100644 index 0000000000..04839b2c07 --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResult.vue @@ -0,0 +1,435 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResultTail.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResultTail.vue new file mode 100644 index 0000000000..922579072d --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResultTail.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestSubResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestSubResult.vue new file mode 100644 index 0000000000..79d82f077f --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestSubResult.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestSubResultTail.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestSubResultTail.vue new file mode 100644 index 0000000000..cc7b1ef1bc --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestSubResultTail.vue @@ -0,0 +1,133 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ResponseText.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ResponseText.vue new file mode 100644 index 0000000000..4e73ba03e6 --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ResponseText.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ScenarioResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ScenarioResult.vue new file mode 100644 index 0000000000..25c7976792 --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ScenarioResult.vue @@ -0,0 +1,184 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ScenarioResults.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ScenarioResults.vue new file mode 100644 index 0000000000..f1c1543e9a --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/ScenarioResults.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/Setting.js b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/Setting.js new file mode 100644 index 0000000000..8484218c0c --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/Setting.js @@ -0,0 +1,120 @@ +export function STEP() { + let map = new Map([ + ['ALL', init()], + ['scenario', init()], + ['HTTPSamplerProxy', getDefaultSamplerMenu()], + ['DubboSampler', getDefaultSamplerMenu()], + ['JDBCSampler', getDefaultSamplerMenu()], + ['TCPSampler', getDefaultSamplerMenu()], + ['OT_IMPORT', getDefaultSamplerMenu()], + ['AbstractSampler', getDefaultSamplerMenu()], + ['IfController', getAll()], + ['TransactionController', getAll()], + ['LoopController', getAll()], + ['ConstantTimer', []], + ['JSR223Processor', getDefaultSamplerMenu()], + ['JSR223PreProcessor', []], + ['JSR223PostProcessor', []], + ['JDBCPreProcessor', []], + ['JDBCPostProcessor', []], + ['Assertions', []], + ['Extract', []], + ['JmeterElement', []], + ['CustomizeReq', getDefaultSamplerMenu()], + ['MaxSamplerProxy', getDefaultSamplerMenu()], + ['GenericController', getAll()], + ['SpecialSteps', ['HTTPSamplerProxy', 'Assertions', 'DubboSampler', 'JDBCSampler', 'TCPSampler', 'Sampler', 'AbstractSampler', 'JSR223Processor', 'API', 'MsUiCommand']], + ['AllSamplerProxy', ['GenericController','HTTPSamplerProxy', 'DubboSampler', 'JDBCSampler', 'TCPSampler', 'Sampler', 'AbstractSampler', 'JSR223Processor', 'API', 'MsUiCommand']], + ['DEFINITION', ['HTTPSamplerProxy', 'DubboSampler', 'JDBCSampler', 'TCPSampler']], + ['ALlSamplerStep', ['JSR223PreProcessor', 'JSR223PostProcessor', 'JDBCPreProcessor', 'JDBCPostProcessor', 'Assertions', 'Extract', 'ConstantTimer']], + ['AllCanExecType', ['HTTPSamplerProxy', 'DubboSampler', 'JDBCSampler', 'TCPSampler', 'JSR223Processor', 'AbstractSampler']]]); + return map +} + +export const ELEMENT_TYPE = { + scenario: 'scenario', + HTTPSamplerProxy: 'HTTPSamplerProxy', + OT_IMPORT: 'OT_IMPORT', + IfController: 'IfController', + TransactionController: 'TransactionController', + ConstantTimer: 'ConstantTimer', + JSR223Processor: 'JSR223Processor', + JSR223PreProcessor: 'JSR223PreProcessor', + JSR223PostProcessor: 'JSR223PostProcessor', + JDBCPostProcessor: 'JDBCPostProcessor', + JDBCPreProcessor: 'JDBCPreProcessor', + Assertions: 'Assertions', + Extract: 'Extract', + CustomizeReq: 'CustomizeReq', + LoopController: 'LoopController', + Plugin: 'Plugin' +} + +export const TYPE_TO_C = new Map([ + ['scenario', 'io.metersphere.hashtree.MsScenario'], + ['customCommand', 'io.metersphere.xpack.ui.hashtree.MsUiCustomCommand'], + ['UiScenario', 'io.metersphere.hashtree.MsUiScenario'], + ['HTTPSamplerProxy', 'io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy'], + ['DubboSampler', 'io.metersphere.api.dto.definition.request.sampler.MsDubboSampler'], + ['JDBCSampler', 'io.metersphere.api.dto.definition.request.sampler.MsJDBCSampler'], + ['TCPSampler', 'io.metersphere.api.dto.definition.request.sampler.MsTCPSampler'], + ['IfController', 'io.metersphere.dto.request.controller.MsIfController'], + ['TransactionController', 'io.metersphere.dto.request.controller.MsTransactionController'], + ['LoopController', 'io.metersphere.dto.request.controller.MsLoopController'], + ['ConstantTimer', 'io.metersphere.dto.request.timer.MsConstantTimer'], + ['JSR223Processor', 'io.metersphere.api.dto.definition.request.processors.MsJSR223Processor'], + ['JSR223PreProcessor', 'io.metersphere.api.dto.definition.request.processors.pre.MsJSR223PreProcessor'], + ['JSR223PostProcessor', 'io.metersphere.api.dto.definition.request.processors.post.MsJSR223PostProcessor'], + ['JDBCPreProcessor', 'io.metersphere.api.dto.definition.request.processors.pre.MsJDBCPreProcessor'], + ['JDBCPostProcessor', 'io.metersphere.api.dto.definition.request.processors.post.MsJDBCPostProcessor'], + ['Assertions', 'io.metersphere.api.dto.definition.request.assertions.MsAssertions'], + ['Extract', 'io.metersphere.dto.request.extract.MsExtract'], + ['JmeterElement', 'io.metersphere.dto.request.unknown.MsJmeterElement'], + ['TestPlan', 'io.metersphere.hashtree.MsTestPlan'], + ['ThreadGroup', 'io.metersphere.hashtree.MsThreadGroup'], + ['DNSCacheManager', 'io.metersphere.api.dto.definition.request.dns.MsDNSCacheManager'], + ['DebugSampler', 'io.metersphere.hashtree.MsDebugSampler'], + ['AuthManager', 'io.metersphere.dto.request.auth.MsAuthManager'] +]) + +export const PLUGIN_ELEMENTS = new Map([ + ['menu_post_processors', ['HtmlExtractor', 'JMESPathExtractor', 'JSONPostProcessor', 'RegexExtractor', 'BoundaryExtractor', 'Separator', 'XPath2Extractor', 'XPathExtractor', 'ResultAction', 'DebugPostProcessor', 'BeanShellPostProcessor']], + ['menu_assertions', ['JSONPathAssertion', 'SizeAssertion', 'JSR223Assertion', 'XPath2Assertion', 'Separator', 'HTMLAssertion', 'JMESPathAssertion', 'MD5HexAssertion', 'SMIMEAssertion', 'XMLSchemaAssertion', 'XMLAssertion', 'XPathAssertion', 'DurationAssertion', 'CompareAssertion', 'BeanShellAssertion']], + ['menu_listener', ['AbstractVisualizer', 'AbstractListener', 'ViewResultsFullVisualizer', 'SummaryReport', 'StatVisualizer', 'BackendListener', 'Separator', 'JSR223Listener', 'ResultSaver', 'RespTimeGraphVisualizer', 'GraphVisualizer', 'AssertionVisualizer', 'ComparisonVisualizer', 'StatGraphVisualizer', 'Summariser', 'TableVisualizer', 'SimpleDataWriter', 'MailerVisualizer', 'BeanShellListener']], + ['menu_pre_processors', ['AbstractPostProcessor', 'UserParameters', 'Separator', 'AnchorModifier', 'URLRewritingModifier', 'SampleTimeout', 'RegExUserParameters', 'BeanShellPreProcessor']], + ['menu_logic_controller', ['GenericController', 'scenario', 'IfController', 'LoopController', 'IfControllerPanel', 'TransactionController', 'LoopControlPanel', 'WhileController', 'Separator', 'ForeachControlPanel', 'IncludeController', 'RunTime', 'CriticalSectionController', 'InterleaveControl', 'OnceOnlyController', 'RecordController', 'LogicController', 'RandomControl', 'RandomOrderController', 'ThroughputController', 'SwitchController', 'ModuleController']], + ['menu_fragments', ['TestFragmentController']], + ['menu_non_test_elements', ['ProxyControl', 'HttpMirrorControl', 'GenerateTree', 'PropertyControl']], + ['menu_generative_controller', ['HTTPSamplerProxy', 'JSR223Processor', 'DubboSampler', 'JDBCSampler', 'TCPSampler', 'Sampler', 'AbstractSampler', 'CustomizeReq', 'HttpTestSample', 'TestAction', 'DebugSampler', 'JSR223Sampler', 'Separator', 'AjpSampler', 'AccessLogSampler', 'BeanShellSampler', 'BoltSampler', 'FtpTestSampler', 'GraphQLHTTPSampler', 'JDBCSampler', 'JMSPublisher', 'JMSSampler', 'JMSSubscriber', 'JUnitTestSampler', 'JavaTestSampler', 'LdapExtTestSampler', 'LdapTestSampler', 'SystemSampler', 'SmtpSampler', 'TCPSampler', 'MailReaderSampler']], + ['menu_threads', ['SetupThreadGroup', 'PostThreadGroup', 'ThreadGroup']], + ['menu_timer', ['ConstantTimer', 'UniformRandomTimer', 'PreciseThroughputTimer', 'ConstantThroughputTimer', 'Separator', 'JSR223Timer', 'SyncTimer', 'PoissonRandomTimer', 'GaussianRandomTimer', 'BeanShellTimer']], + ['menu_config_element', ['CSVDataSet', 'HeaderPanel', 'CookiePanel', 'CacheManager', 'HttpDefaults', 'Separator', 'BoltConnectionElement', 'DNSCachePanel', 'FtpConfig', 'AuthPanel', 'DataSourceElement', 'JavaConfig', 'LdapExtConfig', 'LdapConfig', 'TCPConfig', 'KeystoreConfig', 'ArgumentsPanel', 'LoginConfig', 'SimpleConfig', 'CounterConfig', 'RandomVariableConfig']], +]) + +export function getDefaultSamplerMenu() { + let array = []; + array = array.concat(PLUGIN_ELEMENTS.get('menu_assertions')); + array = array.concat(PLUGIN_ELEMENTS.get('menu_pre_processors')); + array = array.concat(PLUGIN_ELEMENTS.get('menu_post_processors')); + array = array.concat(PLUGIN_ELEMENTS.get('menu_config_element')); + array = array.concat(PLUGIN_ELEMENTS.get('menu_listener')); + return array; +} + +export function init() { + let allArray = []; + allArray = allArray.concat(PLUGIN_ELEMENTS.get('menu_generative_controller')); + allArray = allArray.concat(PLUGIN_ELEMENTS.get('menu_logic_controller')); + allArray = allArray.concat(['scenario', 'ConstantTimer', 'JSR223Processor', 'Assertions']); + return allArray; +} + +export function getAll() { + let allArray = []; + allArray = allArray.concat(getDefaultSamplerMenu()); + allArray = allArray.concat(PLUGIN_ELEMENTS.get('menu_logic_controller')); + allArray = allArray.concat(PLUGIN_ELEMENTS.get('menu_non_test_elements')); + allArray = allArray.concat(PLUGIN_ELEMENTS.get('menu_generative_controller')); + allArray = allArray.concat(PLUGIN_ELEMENTS.get('menu_threads')); + return allArray; +} diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiCommandResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiCommandResult.vue new file mode 100644 index 0000000000..b21c84e9d7 --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiCommandResult.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiCommandResultDetail.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiCommandResultDetail.vue new file mode 100644 index 0000000000..080ac7d61b --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiCommandResultDetail.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiScreenshotViewer.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiScreenshotViewer.vue new file mode 100644 index 0000000000..e0ba05ba9b --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiScreenshotViewer.vue @@ -0,0 +1,59 @@ + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiShareReportDetail.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiShareReportDetail.vue new file mode 100644 index 0000000000..6ba2c9cecb --- /dev/null +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/UiShareReportDetail.vue @@ -0,0 +1,762 @@ + + + + + + diff --git a/test-track/frontend/src/business/plan/view/comonents/ui/TestPlanUiScenarioList.vue b/test-track/frontend/src/business/plan/view/comonents/ui/TestPlanUiScenarioList.vue index e15d1b585b..a55bbbb9a1 100644 --- a/test-track/frontend/src/business/plan/view/comonents/ui/TestPlanUiScenarioList.vue +++ b/test-track/frontend/src/business/plan/view/comonents/ui/TestPlanUiScenarioList.vue @@ -165,7 +165,7 @@ - + diff --git a/test-track/frontend/src/business/utils/sdk-utils.js b/test-track/frontend/src/business/utils/sdk-utils.js index bbf07d58c8..9f74097a9d 100644 --- a/test-track/frontend/src/business/utils/sdk-utils.js +++ b/test-track/frontend/src/business/utils/sdk-utils.js @@ -1,4 +1,4 @@ -export {operationConfirm, removeGoBackListener, handleCtrlSEvent, byteToSize, getTypeByFileName, strMapToObj} from "metersphere-frontend/src/utils"; +export {operationConfirm, removeGoBackListener, handleCtrlSEvent, byteToSize, getTypeByFileName, strMapToObj, getUUID, windowPrint} from "metersphere-frontend/src/utils"; export {parseCustomFilesForList, getCustomFieldFilter, buildBatchParam} from "metersphere-frontend/src/utils/tableUtils"; export {getCurrentProjectID, getCurrentWorkspaceId, getCurrentUser} from "metersphere-frontend/src/utils/token"; export {hasLicense, hasPermissions, hasPermission} from "metersphere-frontend/src/utils/permission";