Overview
Postman allows users to automate workflows by configuring webhooks that trigger on various events. This problem focuses on building a user-friendly multi-step form for creating and configuring a new webhook. A guided, intuitive experience is crucial for users setting up complex integrations, ensuring all necessary details are captured accurately across different configuration stages.
What you need to do / Task
Your task is to implement a 3-step multi-step form for configuring a webhook. The form should:
-
Step 1: Basic Information
- Collect
Webhook Name (text, required)
- Collect
Description (textarea, optional)
- Collect
Status (checkbox, active by default)
-
Step 2: Endpoint Configuration
- Collect
Endpoint URL (text/url, required)
- Collect
HTTP Method (dropdown: POST, GET, PUT, DELETE - POST by default)
- Collect
Request Body (textarea, JSON/text)
- Note: Headers are pre-filled and read-only for this problem's scope.
-
Step 3: Review & Confirm
- Display a summary of all data collected from Step 1 and Step 2.
- Include a 'Submit Webhook' button.
-
Navigation & State Management
- Implement 'Next' and 'Previous' buttons to navigate between steps.
- Persist form data across steps as the user navigates.
-
Client-side Validation
- Implement basic validation for required fields before allowing the user to advance to the next step.
- Display appropriate error messages for validation failures.
-
Submission
- On the final 'Review' step, clicking 'Submit Webhook' should log the entire
formData object to the console and display an alert confirming submission (no actual API call needed).
UI/UX expectations
- The form should clearly indicate the current step (e.g., using step dots).
- 'Next' button should be available to advance, 'Previous' button to go back.
- The 'Submit Webhook' button should only appear on the final step.
- Error messages for validation failures should be clearly visible next to the relevant input fields.
- Basic styling is provided in
styles.css to give a reasonable appearance.
Acceptance criteria
- The form renders with Step 1 active upon initial load.
- 'Next' button correctly advances to the subsequent step, preserving all entered data.
- 'Previous' button correctly navigates back to the preceding step, preserving all entered data.
- Attempting to advance with empty required fields (Webhook Name, Endpoint URL) displays an error message and prevents step progression.
- Step 3 (Review & Confirm) accurately displays all collected form data.
- Clicking 'Submit Webhook' on Step 3 logs the complete form data to the console and triggers an alert.