Tests

Page Tests

ChurchCRM uses Behat for page load testing Behavior Driven Development.

Running Behat Page Tests

  1. While SSH'd into the vagrant development box, run the following commands:
cd /vagrant
npm test
  1. You should see the result of all individual tests.

Writing Behat Page Tests

Behat page tests use the gherkin syntax.
Behat uses tests written with this syntax to execute requests and validate responses against the defined pages.

All tests should follow this outline:

Feature: Calendar
  In order to see calendar events
  As a User
  I am able to visit the calendar

  Scenario: Open the calendar
    Given I am authenticated as "admin" using "changeme"
    And  I am on "/calendar.php"
    Then I should see "Church Calendar"

Useful reference tests

Unit Tests

Unit testing is not yet fully implemented.