Exam #3: API Testing - User Registration Endpoint
Prompt:
Generate API test cases for the user registration endpoint (POST /api/register) with the following requirements: Users must provide a valid email, password, and username. The password should be hashed, and the response should return a success message or an appropriate error message. Consider functional, negative, boundary, and security test cases.
Example Output:
β’ Verify that sending a valid email, password, and username returns a 201 Created response.
β’ Verify that sending an already registered email returns a 409 Conflict error.
β’ Verify that missing any required field results in a 400 Bad Request response.
β’ Verify that the password is not returned in the response.
β’ Verify that SQL injection attempts in the username field are blocked.
β’ Verify that sending an excessively long username (e.g., 300 characters) is handled properly.
β’ Verify that API rate-limiting prevents spam registrations.
β’ Verify that the system does not expose sensitive error details.
Last updated