Validation Scenarios

Test how SDK handles validation success/failure at client and server levels

What These Tests Cover

Validation can block form submission at the client (JavaScript) or server (HTTP response). The SDK should only capture identity from successful submissions, not failed validation attempts.

1. Client Validation Pass Should Capture

Form with required fields. User fills correctly and submits. Validation passes.

Test: Fill in both fields (pre-filled valid values), click submit.
Please enter a valid email
Name is required
Expected: SHOULD capture pp event - form submitted successfully

2. Client Validation Fail Should NOT Capture

Form with validation that fails. event.preventDefault() blocks submission.

Test: Leave email empty or invalid, click submit. Form should show error.
Please enter a valid email address
Expected: SHOULD NOT capture - form submission blocked by validation

3. Server Validation Pass Should Capture

Form submits via AJAX. Mock server returns success response (200 OK).

Test: Submit form. Server will return success.
Expected: SHOULD capture from network request

4. Server Validation Fail Depends

Form submits via AJAX. Server returns error JSON (400 Bad Request simulation).

Test: Submit form. Server will return validation error.
Expected: MAY capture from network request (SDK sees the request, but validation failed)

5. Retry After Error Capture on Success

First submit fails validation. User fixes and resubmits successfully.

Test: Click submit (will fail), then click "Fix & Retry" button.
Email is required
Expected: SHOULD capture only on the second (successful) submission

6. Async Validation Capture on Submit

Email field validates on blur (async check). Only captures on final form submit.

Test: Type email, tab out (blur triggers validation), then submit form.
Invalid email format
Expected: SHOULD capture only on form submit, not on blur validation
[Ready] Validation Tests Loaded