fix: display ai assert in html report

This commit is contained in:
lilong.129
2025-07-06 11:08:52 +08:00
parent af40d082f7
commit d329fb610f
6 changed files with 183 additions and 17 deletions

View File

@@ -492,9 +492,10 @@ func (dExt *XTDriver) AIAssert(assertion string, opts ...option.ActionOption) (*
return assertResult, errors.Wrap(err, "AI assertion failed")
}
// For assertion failure, we should still return success but mark the assertion as failed
// This ensures that the AIResult (including screenshot and thought) is properly saved and displayed
if !result.Pass {
assertResult.Error = result.Thought
return assertResult, errors.New(result.Thought)
assertResult.Error = result.Thought // Store the failure reason for reporting
}
return assertResult, nil