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

LLM exception suggestion front end #545

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
28 changes: 19 additions & 9 deletions react/src/component/PropertyTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class AdaptivePropertyTable extends React.Component {
<StyledTableRow key={key} >
<TableCell key={key} style={{ verticalAlign: 'top' }}><b>{key}</b></TableCell>
<TableCell colSpan={colSpan - 1} style={{ maxWidth: "640px" }}>
{showedValueElement ? showedValueElement : value.toString()}
{ showedValueElement ? showedValueElement : value.toString() }
</TableCell>
</StyledTableRow>)
} else {
Expand Down Expand Up @@ -105,14 +105,24 @@ export default class AdaptivePropertyTable extends React.Component {
</TableHead>
}

return <TableContainer component={Paper}>
<Table aria-label="simple table" size="small">
{titlePart}
<TableBody>
{pList}
</TableBody>
</Table>
</TableContainer>
return <center>
<TableContainer component={Paper}>
<Table aria-label="simple table" size="small">
{titlePart}
<TableBody>
{pList}
</TableBody>
</Table>
</TableContainer>
<table className="table table-borderless">
<tbody>
<tr>
<td align='center'>
</td>
</tr>
</tbody>
</table>
</center>
}

componentDidMount() {
Expand Down
24 changes: 22 additions & 2 deletions react/src/component/SearchView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,35 @@ 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(details[k]);
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: <center><VideoNavView videoInfo={info} videos={vList} />
infoDisplay: <center>
<VideoNavView videoInfo={info} videos={vList} />
{
suggestions.length > 0 ?
<AdaptivePropertyTable properties={suggestions}
title='LLM Suggestions'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title='LLM Suggestions'
title='Test Result Analysis'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can generalize this in user interface, no need to mention the solution LLM behind it.

lineTextCount='1'
propertyValueProcessor={(key, value) => {
return <div>{value}</div>
}} /> : null
}
<AdaptivePropertyTable properties={properties}
title='Test Case Details'
propertyValueProcessor={(key, value) => {
Expand Down