[Drupal] How to test the credit card payment in drupal websites?

| | 2 min read

Suppose you have a drupal website which uses drupal ubercart module for handling payments. Your drupal website has several online products which can be purchased using credit card. In Drupal projects, we have to enter credit card informations in the Checkout page.

credit card.jpg

Please consider the following testcases which can be used to test credit card functionality.

  1. Ensure that the user is able to select the credit card payment method in the checkout page.
  2. Ensure that a field 'Card Number' is displayed in the payment method block.
  3. Ensure that a field 'Expiration Date' is displayed in the payment method block.
  4. Ensure that a field 'CVV' is displayed in the payment method block.
  5. Ensure that the user is able to enter the credit card number, expiration date, and CVV number.
  6. Ensure that an error message is displayed on leaving any field blank.
  7. Ensure that an error message is displayed on entering an invalid card number.
  8. Ensure that an error message is displayed on entering characters/symbols in card number field.
  9. Ensure that an error message is displayed on selecting an invalid expiration date.
  10. Ensure that an error message is displayed on entering an invalid CVV number.
  11. Ensure that an error message is displayed on entering characters/symbols in CVV field.
  12. Ensure that the card number and cvv number are removed on refreshing the check out page.
  13. Ensure that the user is redirected to Review order page on entering the valid credit card details.
  14. Ensure that the payment method is displayed as credit card in the Review order page.
  15. Ensure that only the last 4 digits of the card no: is displayed in the Review order page.
  16. Ensure that the expiration date is displayed in the Review order page.
  17. Ensure that CVV number is not displayed in the Review order page.
  18. Ensure that the user is redirected to the Check out page on clicking the back button.
  19. Ensure that the card number and CVV number are not displayed in the check out page.

Please note that the fields may change according to the specific project. In some of the projects, CVV fields may not be used. Here, I have specified all the fields. Thus, we can verify all the fields in the Drupal project by going through the above test cases.