AI can draft tests quickly, but speed is not the same as coverage. If your team is using Antigravity to help write automation, the real quality gain comes from the review step. This Antigravity review AI written tests workflow shows QA engineers how to inspect generated tests before commit, catch weak assertions, reduce flaky timing logic, and confirm that the test would fail for the right reason if the product broke.
The process below stays close to what Google documents officially: create a project, start an agent, use slash-command style workflows, add reusable instructions with AGENTS.md and SKILL.md, and keep the human reviewer responsible for the final decision. That makes this tutorial practical without depending on unstable product claims.
Why review AI-written tests before commit
AI-generated automation often looks clean on the surface. The risk is that it can still miss the business rule you actually care about. In practice, QA teams usually find the same failure patterns:
- The test only checks that a page loaded, not that the user outcome was correct.
- The locator works today but is tied to brittle text, index order, or temporary CSS.
- The script waits longer instead of waiting smarter, which hides race conditions.
- The flow uses mocks or stubs so heavily that it stops validating the real integration path.
- The test passes even when the bug it claims to prevent is still present.
Antigravity is useful here because the agent can inspect repository context, read existing tests, and follow reusable instructions. That makes it better suited for structured QA review than a one-off chatbot prompt with no project standards.
Set up the review context in Antigravity
Before you ask for feedback, give the agent the same context a strong code reviewer would need. Open the repo that contains the generated test and point Antigravity at the file or diff you want reviewed. Then add a short repository instruction file so the agent knows what good testing looks like in your team.
Starter AGENTS.md
Review AI-written UI and API tests using these rules:
- Prefer stable, user-facing locators over CSS chains.
- Flag assertions that only check status codes or visibility.
- Call out missing negative, boundary, and state-transition coverage.
- Warn when waits are time-based instead of event-based.
- Treat heavy mock use as a risk unless the test goal is unit scope.
- Recommend the smallest safe fix and the exact rerun needed.
This is not a magic file. It simply makes your standards explicit so the agent can apply them consistently across multiple reviews.
Step-by-step Antigravity review AI written tests workflow
1. Start with the test goal, not the code style
Paste a short instruction such as: Review this AI-written checkout test. Tell me what regression it proves, where the assertions are weak, and what would make it fail for the correct reason. This frames the session around product risk rather than cosmetic cleanup.
2. Ask the agent to summarize the scenario
A good first response should describe the user flow, the expected outcome, and the main verification points. If the agent cannot explain the scenario clearly, that usually means the test itself is vague or overcomplicated. Fix that before touching locators.
3. Inspect assertions first
Assertions decide whether a test is meaningful. Ask Antigravity to classify each assertion as one of three types: surface-level, structural, or business-validating. For example, an assertion that a success toast is visible is weaker than verifying that the order number appears and the saved status changed in the UI or API response.
For API tests, status code checks alone are rarely enough. For UI tests, a visible page element is rarely enough. The review should push the test toward evidence that matters to the user or the system contract.
4. Check locator quality and wait strategy
Next, ask the agent to flag brittle selectors and time-based waits. Stable reviews usually recommend accessible roles, labels, test ids, or domain-specific anchors over nested CSS chains. They also replace blind sleep-style timing with waits tied to a visible result, network completion, or state change.
If the generated test needs multiple manual timing patches to pass, that is a sign the flow may be too broad or the app state is not controlled well enough for automation.
5. Look for missing negative coverage
AI-written tests often cover the happy path and stop there. Ask Antigravity for the smallest set of missing negative or boundary cases. For a login test, that might be invalid password handling, locked-user messaging, or session timeout behavior. For a checkout test, it might be stock changes, card decline handling, or stale cart state.
6. Challenge mock usage
If the test stubs every backend dependency, ask the agent whether the scenario still validates a real regression. Some mocks are necessary, especially in isolated unit scope. But for end-to-end or higher-value integration flows, heavy mocking can create a false sense of confidence. Antigravity should help you identify where a narrower unit test is fine and where a realistic integration path is the safer choice.
7. Request a minimal patch and rerun plan
After the review, ask for the smallest safe patch. Avoid broad rewrites unless the original structure is unsalvageable. The output should include:
- The exact lines or sections that need to change.
- Why each change improves signal quality.
- The smallest rerun scope, such as one Playwright spec, one pytest file, or one API collection.
- What result would still require human follow-up.
Try this prompt
Review this AI-written test before commit.
Focus on:
1. What regression the test actually proves.
2. Weak assertions or missing business validation.
3. Brittle locators or timing-based waits.
4. Overuse of mocks that reduce real coverage.
5. The smallest safe patch and the exact rerun plan.
Return the answer as:
- risks
- recommended changes
- missing scenarios
- validation steps
QA checklist for the final decision
- Can you explain the regression the test protects in one sentence?
- Would the test fail if the key business behavior broke?
- Are the assertions stronger than simple visibility or status checks?
- Do the locators reflect stable user-facing semantics?
- Is the wait strategy event-based instead of time-based?
- Are mocks used only where the chosen scope justifies them?
- Did you rerun the smallest relevant test scope after the patch?
Common mistakes
The biggest mistake is treating the agent review as approval. Antigravity can accelerate inspection, but it cannot own the quality bar for your suite. Another common mistake is asking for a full rewrite too early. Small, evidence-driven fixes usually preserve maintainability better than replacing the whole test with a second AI draft. Teams also lose signal when they forget to encode review rules in AGENTS.md or a skill, because each session then starts from scratch.
Screenshot checklist
- The Antigravity project view with the target test file open.
- The first review prompt asking for assertion, locator, and mock analysis.
- The agent response that identifies weak assertions or brittle waits.
- The diff showing the minimal patch before commit.
- The local rerun result for the updated test scope.
References
- https://antigravity.google/docs
- https://antigravity.google/docs/skills
- https://antigravity.google/docs/ide-rules
- https://blog.google/innovation-and-ai/technology/developers-tools/managed-agents-gemini-api/
FAQ
Can Antigravity replace human test review?
No. It can speed up analysis and suggest safer patches, but a QA engineer still needs to confirm coverage, rerun the right scope, and decide whether the test belongs in the suite.
Is this workflow only for Playwright tests?
No. The same review pattern works for Selenium, API, and pytest-based tests as long as you ask the agent to focus on assertions, waits, mocks, and regression value.
What is the best first instruction to give the agent?
Ask what regression the test proves and whether the current assertions would fail for the right reason. That question usually exposes the largest quality gap fastest.
Should I create a skill for review tasks?
Yes, if your team repeats the same checks often. A reusable skill or AGENTS.md file helps the agent apply the same QA standards across repositories and reviews.
Conclusion
The best Antigravity review AI written tests process is simple: provide context, inspect assertions before style, challenge brittle waits and heavy mocks, ask for the smallest safe patch, and rerun the right scope before commit. When QA teams use Antigravity this way, the agent becomes a structured reviewer that improves signal quality instead of a shortcut that quietly adds weak tests to the suite.
