---
title: "Validate fields revealed by a conditional choice"
description: "Verify that shipping fields become required only for physical delivery and that switching back to digital delivery removes obsolete validation."
canonical_url: "https://vostride.com/agent-library/forms-validation/conditional-required-address.md"
md_url: "https://vostride.com/agent-library/forms-validation/conditional-required-address.md"
content_kind: "recipe"
topic: "forms-validation"
---

# Validate fields revealed by a conditional choice

Verify that shipping fields become required only for physical delivery and that switching back to digital delivery removes obsolete validation.

## Risk

Hidden conditional fields sometimes keep blocking submission, while newly revealed fields may fail to join validation. Exercise both branch transitions using an order draft that has no payment or fulfillment side effects.

## Fixtures

- A test product supports Digital and Physical delivery in a non-fulfilling draft environment.
- Digital delivery requires email; Physical additionally requires a street address and postal code.
- A fixture manifest provides an allowed synthetic email and a complete test shipping address.

## Steps

1. Open the order draft and choose Physical delivery; verify street address and postal code fields appear.
2. Enter the synthetic email but leave shipping fields empty, then save; verify explicit address and postal-code errors.
3. Switch to Digital delivery and verify the shipping fields disappear and their errors no longer block the draft.
4. Save and verify the resulting draft shows Digital delivery and the expected email with no shipping requirement.
5. Edit the draft, select Physical, enter the complete address, and save; verify the detail now shows the intended delivery branch and address.

## Expected results

- The Physical branch rejects missing shipping data before creating a deliverable order.
- The Digital branch can save without values in hidden shipping controls.
- After the final edit, the saved branch and address match the prepared fixture rather than stale hidden inputs.

## False-pass traps

- A disabled save button after switching to Digital can expose lingering invalid state even if errors are hidden.
- An environment that actually fulfills orders is not the defined fixture for this test.

## Cleanup

- Delete the non-fulfilling test draft and reset the fixture product if its delivery settings changed.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Forms and validation QA recipes](/agent-library/forms-validation.md)
- [Software factory QA library](/agent-library.md)
