A contact form is included with websites mainly with an intention to allow users to communicate with the site administrator, sharing their feedback/messages regarding the website or reaching out to the business owner of the site for services / support. In this article I have covered a set of test cases that can be used to test the Drupal site contact form.
In Drupal you can limit the number of submissions that can be accepeted from an IP within an hour. Further submissions within that time period will not be accepted by the system. See the attached contact form.
These are the default fields found in a default drupal contact form along with the captcha. Following are its test cases/checklists:
- Ensure that an error message is displayed on submitting the form by leaving the mandatory fields empty. Expected error messages for the above example is:
- "Your name field is required."
- "Your e-mail address field is required."
- "Subject field is required."
- "Message field is required."
- "Math question field is required."
- Ensure that the system accepts valid name. For example: a name "@run" which when given in the field will be accepted.
By default text fields in drupal accepts alphanumeric values. If the field is customized, then test accordingly.
- Ensure that the system rejects the invalid name (input:*##456456@#).
- Ensure that the system accepts valid e-mail ids. For example; an id: firstname.lastname@example.org should be accepted.
- Ensure that the system rejects invalid e-mail ids. For example; inputs "tester@example", "tester.example@com" should not be accepted.
- Ensure that the system accepts the valid subject. Usually all alphanumeric entries will be accepted. If there is any other specifications like character limits etc, check that as well.
- Ensure that the system accepts valid messages. Usually all alphanumeric entries will be accepted. If there is any other specifications like character limits etc, check that as well.
- Ensure that the system accepts valid captcha.
- Ensure that the system rejects the invalid captcha.
- Ensure that the captcha code resets as the system reloads.
- Ensure that the captcha changes as the user enters wrong value.
- Ensure that the spelling and position of the button is correct.
- Ensure that the button is clickable.
- Ensure that on submitting a valid form,the value get saved and administrator receives the same.
- Ensure that the administrator receives the contact form at the email address which has been configured. The administrator can set/edit email id on Contact form by selecting the contact form from administrator menu bar - Menu » Site Building » Contact form » List.
Happy testing :)..