docs/ai_builder/features/automated_testing.md
Reflex Build can generate and run tests from plain-language descriptions. Use tests to verify important app behavior after generation and before sharing or deploying.
import reflex as rx
For example:
Open the sign-in page, submit an invalid email, and verify that the form shows
an error without navigating. Then enter valid credentials and verify that the
dashboard opens.
rx.image(
src="https://web.reflex-assets.dev/docs-preview/ai-builder/platform/testing_browser.webp",
alt="Passing tests in the Reflex Build Testing panel",
class_name="rounded-md h-auto mb-4",
border=f"0.81px solid {rx.color('slate', 5)}",
)
The Testing panel lets you search existing tests, run an individual test, or use Run All. Review the status and output of a failed test before asking the agent to change the app.
A failed test can indicate a problem in the app, an outdated expectation, or an ambiguous test description. Check the tested workflow in Preview before deciding which one to change.
Prioritize behavior that would block a user:
Keep each test focused on one workflow. Small tests are easier to understand and maintain than one test that tries to cover the whole app.