Skip to content
Snippets Groups Projects

TESTING

!!! note The tests included with the Stripe extension have not been updated for 6.x

PHPUnit

This extension comes with two PHP Unit tests:

  • Ipn - This unit test ensures that a recurring contribution is properly updated after the event is received from Stripe and that it is properly canceled when cancelled via Stripe.
  • Direct - This unit test ensures that a direct payment to Stripe is properly recorded in the database.

Tests can be run most easily via an installation made through CiviCRM Buildkit (https://github.com/civicrm/civicrm-buildkit) by changing into the extension directory and running:

phpunit6 tests/phpunit/CRM/Stripe/IpnTest.php
phpunit6 tests/phpunit/CRM/Stripe/DirectTest.php

Katalon Tests

See the test/katalon folder for instructions on running full web-browser based automation tests.

Expects a drupal (demo) site installed at http://localhost:8001

  1. Login: No expected result, just logs into a Drupal CMS.
  2. Enable Stripe Extension: Two payment processors are created, can be done manually but processor labels must match or subsequent tests will fail.
  3. Offline Contribution, default PP: A contribution is created for Arlyne Adams with default PP.
  4. Offline Contribution, alternate PP: A contribution is created for Arlyne Adams with alternate PP.
  5. Offline Membership, default PP: A membership/contribution is created for Arlyne Adams with default PP.
  6. Offline Membership, alternate PP: A membership/contribution is created for Arlyne Adams with alternate PP.
  7. Offline Event Registration, default PP: A participant record/contribution is created for Arlyne Adams with default PP.
  8. Offline Event Registration, alternate PP: A participant record/contribution is created for Arlyne Adams with alternate PP.
  9. Online Contribution Stripe Default Only: A new contribution record is created.
  10. Online Contribution Page 2xStripe, Test proc, use Stripe Alt: A new contribution record is created. FAIL: Error Oops! Looks like there was an error. Payment Response: Type: invalid_request_error Code: resource_missing Message: No such token: Stripe Token
  11. Online Contribution Page Stripe Default, Pay Later: A new contribution record is created.
  12. Test Webform: A new contribution is created. Partial test only

ONLINE contribution, event registration tests

Manual Tests

  1. Test webform submission with payment and user-select , single processor.

  2. TODO: Are we testing offline contribution with single/multi-processor properly when stripe is/is not default with katalon tests?

  3. Test online contribution page on Wordpress.

  4. Test online contribution page on Joomla.

  5. Test online event registration (single processor).

  6. Test online event registration (no confirmation page).

  7. Test online event registration (multiple participants).

  8. Test online event registration (multiple processors, Stripe default).

  9. Test online event registration (multiple processors, Stripe not default).

  10. Test online event registration (cart checkout).

Drupal Webform Tests

TODO: Add these as Katalon tests.

  1. Webform with single payment processor (Stripe) - Amount = 0.
  2. Webform with single payment processor (Stripe) - Amount > 0.
  3. Webform with multiple payment processor (Stripe selected) - Amount = 0.
  4. Webform with multiple payment processor (Stripe selected) - Amount > 0.
  5. Webform with multiple payment processor (Pay Later selected) - Amount = 0.
  6. Webform with multiple payment processor (Pay Later selected) - Amount > 0.
  7. Webform with multiple payment processor (Non-stripe processor selected) - Amount = 0.
  8. Webform with multiple payment processor (Non-stripe processor selected) - Amount > 0.