Before you start
In TrustAI- A test or scenario that has run and didn’t pass. To practise, write one that fails on purpose: for example, a test
that creates an Account named
Example Onebut checks for the nameExample Two. Give the Account a name no other record has, and check that the test’s Teardown deletes it. - The Editor or Admin project role in the project.
- Credits in your workspace. Runs use them.
Find out why it failed
A test: read Why it failed
- On Runs, click the run. You should see: the test’s result, with its header: for example Failed. The result has a Why it failed card.
- Read Why it failed from top to bottom. You should see: on its top line, who or what it thinks is at fault, as a badge (such as App or Test), then how sure it is and how it decided (such as “Medium confidence · Rules”). Under that, What happened says what went wrong in one sentence, and Reasoning says why it blames that cause.
- Click Go to step with its number, such as Go to step 5, to read that step in the replay. You should see: the Replay, with that step marked Failed and the check that didn’t pass.
A scenario: read each check
Open the scenario’s result. On the Verdict tab, click the words of each check marked Fail to read Why it fails, with Show in transcript. Checks can also be marked Not determined. Then read the conversation on the left. Test an Agentforce agent explains both. Ask yourself: did the agent do the wrong thing, or is the check asking for the wrong thing? If the agent is wrong, fix the agent and run again. If the check is wrong, change the verdict and improve the scenario, as below.Change a verdict and improve the scenario
Agent evaluation only. Functional test results have no way to change the verdict. When you disagree with how TrustAI graded a check, change the verdict with your reason. Then use that reason to improve the scenario, so later runs are graded the way you meant.- On the Verdict tab, click the check’s verdict, such as Fail. Choose the other verdict (“Override the system, with a reason.”), write why under Why does this pass?, and click Change to Pass. Run tests and read results shows this step by step. You should see: the check shows your verdict, with the system’s grade and its reason above yours. The count at the top is worked out again: in our walkthrough it went from Fail, “1 of 7 failed, 2 not checked”, to Not checked, “2 of 7 not checked”, with “Changed from fail by 1 override from you”. At the bottom: “1 override not used to improve the scenario yet”, “Later runs are graded the old way until you do.”, and Improve scenario.
- Click Improve scenario. You should see: a dialog with a What should change? box. Under Reviewed run results to address, your reason and the check it’s about.
- Optional: say more in What should change?. Then click Improve scenario at the bottom of the dialog to draft the change. While it works, the button says Drafting. You should see: Review the improved draft, which says what saving replaces and that closing changes nothing. Click Show changes to mark new words in green and strike out the old ones. A part that didn’t change says No changes.
- Click Save changes. You should see: Saved the improved definition, and “This run’s verdicts stay as they are.” To read the new definition, click View definition.
Fix a test with Improve with AI
Improve with AI rewrites a test’s definition. It does what you ask, so say exactly what’s wrong and what the test should check instead. Create a test or scenario introduces it.- Open the test. On its Definition tab, click Improve with AI (the sparkle at the top right). You should see: Improve with AI: “The agent drafts an improved definition. You review what changes before anything is saved.” It has a What should change? box. Improve definition can’t be clicked until you write something.
- In What should change?, say what the result showed and what you want instead. Name the check and the value. For example: “The list view Docs Platinum Partners does not exist in this org. Use the existing list view All Partner Accounts instead, and check that its title All Partner Accounts is shown. Keep everything else.” Click Improve definition. You should see: “Drafting an improved definition. Nothing is saved yet.” Then Review the improved draft: “Saving replaces the saved test plan with this draft. Closing this changes nothing.” It counts what changed, such as “1 document changed”, and has a short note from the agent on what it changed, then the new test plan. Click Show changes to see new words in green and old ones struck out. Hide changes shows the plain text again.
- Read the draft. Click Save changes, or Discard if it changed something you didn’t ask for. To reword your instruction, click Back to instruction. You should see: “Saved just now” on the Definition tab, with the agent’s note and the new definition.
Run it again and compare
- Click the run button (▷) at the top right of the test or scenario, and start the run as before: Run 1 test for a test, Run & evaluate for a scenario. You should see: the run starts. A test shows that it “is running”, with View run details. A scenario opens the run’s page.
- When it ends, open the result and compare it with the last one. You should see: a new result. On a test, the Runs tab lists every run with its result and the first line of Why it failed, newest first. In the list, the requirement shows how many of its tests passed, such as “1 of 1 passed”, and the test shows its latest result, such as Passed. After a run that ended Needs review, the test shows Blocked and the requirement Run blocked.