Test cases for adding coupon code in a Drupal project

| | 3 min read

Suppose your drupal projects contains products to sell. And you can use coupon code while purchasing products. For using coupon code in your druapl site, Ubercart Coupon code module may be installed. Please check the below cases which contains the test cases of checking coupon code functionality.

  1. Ensure that Admin is able to add coupon code.
  2. Ensure that users other than Admin doesnot have the permission to add coupon codes.
  3. Ensure that Admin can add coupon code through
    Store Administration-->Coupons--->Add new Coupon
  4. Ensure that Admin is able to add coupon code by directly open the node id
    eg: sitename/Admin/store/coupons/add
  5. Ensure that error message will be displayed if mandatory fields leaves empty.
  6. Ensure that Admin is able to add Coupon Name.
  7. Ensure that Admin is able to add Coupon Code.
  8. Ensure that Admin is able to select Payment information required field.
  9. Ensure that if Payment information required field is selected, error message will be displayed if we apply applying coupon code for products which doesn't contain payment information.
  10. Ensure that Admin is able to generate bulk coupon codes.
  11. Ensure that Admin is able to select number of coupon codes to be generated.
  12. Ensure that Admin is able to select the code length.
  13. Ensure that Admin is able to select coupon code as active/inactive.
  14. Ensure that Admin is able to add discount as Fixed price discount.
    eg: enter "15" for $15.00 off.
  15. Ensure that Admin is able to add discount as Percentage discount.
    Eg: enter "15%" for 15% off.
  16. Ensure that Admin is able to add discount as Set product price.
    For eg: enter "=15" to make all matching products $15.00 after discount.
  17. Ensure that Admin is able to add Apply discount to:
    Order subtotal
    Total of matching product(s)
    All matching product(s)
    The cheapest matching product(s)
    The most expensive matching product(s)
  18. Ensure that Admin is able to select 'Restrict coupon by date'.
  19. Ensure that error message will be displayed for invalid /expired dates.
  20. Ensure that Admin is able to select Maximum number of redemptions (per code).
  21. Ensure that error message will be displayed after the maximum redemptions per code.
  22. Ensure that Admin is able to select Maximum number of redemptions (per user).
  23. Ensure that error message will be displayed after the maximum redemptions per user.
  24. Ensure that Admin is able to select the Minimum Order limit [minimum amount for discount to apply].
  25. Ensure that error message will be displayed after the maximum redemptions per user.
  26. Ensure that Admin is able to select the Minimum order quantity [Minimum order quantity for discount to apply].
  27. Ensure that error message will be displayed after the Minimum order quantity.
  28. Ensure that Admin is able to select the Applicable product classes.
  29. Ensure that error message will be displayed for other than the Applicable product classes.
  30. Ensure that Admin is able to select the Applicable products.
  31. Ensure that error message will be displayed for other than the Applicable products.
  32. Ensure that Admin is able to select the Applicable SKUs.
  33. Ensure that error message will be displayed for other than the Applicable SKUs.
  34. Ensure that Admin is able to select the Applicable taxonomy terms.
  35. Ensure that error message will be displayed for other than the Applicable taxonomy terms.
  36. Ensure that Admin is able to apply User restrictions.
  37. Ensure that error message will be displayed for other than the specified users.
  38. Ensure that Admin is able to apply Role restrictions.
  39. Ensure that error message will be displayed for other than the specified user roles.
  40. Ensure that Admin is able to see active/inactive coupon codes.
  41. Ensure that Admin is able to delete copons.

Thus we can ensure that all the cases should be checked by going through the above steps. Please be note that cases to be tested may vary depending on the requirement.