From 268878aa2d736a2bd9bf04459a55031dfe390576 Mon Sep 17 00:00:00 2001
From: dexterdreeeam <43837899+DexterDreeeam@users.noreply.github.com>
Date: Sun, 23 Jul 2023 16:56:31 +0800
Subject: [PATCH 1/2] LLM Suggestion for Exception Analyze
---
.../center/service/TestDataService.java | 1 +
react/src/component/PropertyTable.jsx | 28 +++++++++++++------
react/src/component/SearchView.jsx | 21 ++++++++++++--
3 files changed, 39 insertions(+), 11 deletions(-)
diff --git a/center/src/main/java/com/microsoft/hydralab/center/service/TestDataService.java b/center/src/main/java/com/microsoft/hydralab/center/service/TestDataService.java
index 5e29012ff..2ad31d828 100644
--- a/center/src/main/java/com/microsoft/hydralab/center/service/TestDataService.java
+++ b/center/src/main/java/com/microsoft/hydralab/center/service/TestDataService.java
@@ -271,6 +271,7 @@ public void saveTestRunGPTSuggestion(TestRun testRun, String suggestion) {
public void saveTestCaseGPTSuggestion(AndroidTestUnit testCase, String suggestion) {
testCase.setSuggestion(suggestion);
androidTestUnitRepository.save(testCase);
+ keyValueRepository.saveAndroidTestUnit(testCase);
}
public TestRun findTestRunById(String testRunId) {
diff --git a/react/src/component/PropertyTable.jsx b/react/src/component/PropertyTable.jsx
index a4e4852c3..f83cd20c6 100644
--- a/react/src/component/PropertyTable.jsx
+++ b/react/src/component/PropertyTable.jsx
@@ -71,7 +71,7 @@ export default class AdaptivePropertyTable extends React.Component {
{key}
- {showedValueElement ? showedValueElement : value.toString()}
+ { showedValueElement ? showedValueElement : value.toString() }
)
} else {
@@ -105,14 +105,24 @@ export default class AdaptivePropertyTable extends React.Component {
}
- return
-
- {titlePart}
-
- {pList}
-
-
-
+ return
+
+
+ {titlePart}
+
+ {pList}
+
+
+
+
+
}
componentDidMount() {
diff --git a/react/src/component/SearchView.jsx b/react/src/component/SearchView.jsx
index 8f543ab1a..d7c00d54c 100644
--- a/react/src/component/SearchView.jsx
+++ b/react/src/component/SearchView.jsx
@@ -199,15 +199,32 @@ export default class SearchView extends BaseView {
const vList = [res.data.content.videoBlobUrl + '?' + require('local-storage').get('FileToken')]
const info = res.data.content.videoTimeTagArr
const properties = []
+ const suggestions = []
for (var k in details) {
if (k === "stream") {
continue
}
- properties.push({ k: k, v: details[k] })
+ if (k === "suggestion") {
+ const obj = JSON.parse(stringified);
+ for (const [key, value] of Object.entries(obj)) {
+ suggestions.push({ k: key, v: value })
+ }
+ }
+ else {
+ properties.push({ k: k, v: details[k] })
+ }
}
+
this.setState({
- infoDisplay:
+ infoDisplay:
+
+ {
+ return {value}
+ }} />
{
From c5a23e15899843a3660a83ec5f622b5b0123e0bd Mon Sep 17 00:00:00 2001
From: dexterdreeeam <43837899+DexterDreeeam@users.noreply.github.com>
Date: Sun, 23 Jul 2023 17:07:32 +0800
Subject: [PATCH 2/2] u
---
react/src/component/SearchView.jsx | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/react/src/component/SearchView.jsx b/react/src/component/SearchView.jsx
index d7c00d54c..a80072367 100644
--- a/react/src/component/SearchView.jsx
+++ b/react/src/component/SearchView.jsx
@@ -206,7 +206,7 @@ export default class SearchView extends BaseView {
continue
}
if (k === "suggestion") {
- const obj = JSON.parse(stringified);
+ const obj = JSON.parse(details[k]);
for (const [key, value] of Object.entries(obj)) {
suggestions.push({ k: key, v: value })
}
@@ -219,12 +219,15 @@ export default class SearchView extends BaseView {
this.setState({
infoDisplay:
- {
- return {value}
- }} />
+ {
+ suggestions.length > 0 ?
+ {
+ return {value}
+ }} /> : null
+ }
{